浏览代码

Fix issues after merge with master

/main
Martin Thorzen 7 年前
当前提交
d36a05a1
共有 10 个文件被更改,包括 40 次插入40 次删除
  1. 2
      com.unity.shadergraph/Editor/Data/Graphs/BooleanShaderProperty.cs
  2. 4
      com.unity.shadergraph/Editor/Data/MasterNodes/PBRMasterNode.cs
  3. 6
      com.unity.shadergraph/Editor/Data/MasterNodes/UnlitMasterNode.cs
  4. 16
      com.unity.shadergraph/Editor/Data/Nodes/Artistic/Adjustment/InvertColorsNode.cs
  5. 16
      com.unity.shadergraph/Editor/Data/Nodes/Channel/FlipNode.cs
  6. 4
      com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/BooleanNode.cs
  7. 8
      com.unity.shadergraph/Editor/Data/Nodes/UV/FlipbookNode.cs
  8. 20
      com.unity.shadergraph/Editor/Drawing/Controls/ToggleControl.cs
  9. 2
      com.unity.shadergraph/Editor/Drawing/Views/PBRSettingsView.cs
  10. 2
      com.unity.shadergraph/Editor/Drawing/Views/UnlitSettingsView.cs

2
com.unity.shadergraph/Editor/Data/Graphs/BooleanShaderProperty.cs


public override INode ToConcreteNode()
{
return new BooleanNode { value = new Toggle(value) };
return new BooleanNode { value = new ToggleData(value) };
}
}
}

4
com.unity.shadergraph/Editor/Data/MasterNodes/PBRMasterNode.cs


private bool m_TwoSided;
[ToggleControl("Two Sided")]
public Toggle twoSided
public ToggleData twoSided
get { return new Toggle(m_TwoSided); }
get { return new ToggleData(m_TwoSided); }
set
{
if (m_TwoSided == value.isOn)

6
com.unity.shadergraph/Editor/Data/MasterNodes/UnlitMasterNode.cs


public const int AlphaSlotId = 7;
public const int AlphaThresholdSlotId = 8;
[SerializeField]
private SurfaceType m_SurfaceType;

private bool m_TwoSided;
[ToggleControl("Two Sided")]
public Toggle twoSided
public ToggleData twoSided
get { return new Toggle(m_TwoSided); }
get { return new ToggleData(m_TwoSided); }
set
{
if (m_TwoSided == value.isOn)

16
com.unity.shadergraph/Editor/Data/Nodes/Artistic/Adjustment/InvertColorsNode.cs


private bool m_RedChannel;
[ToggleControl("Red")]
public Toggle redChannel
public ToggleData redChannel
get { return new Toggle(m_RedChannel, channelCount > 0); }
get { return new ToggleData(m_RedChannel, channelCount > 0); }
set
{
if (m_RedChannel == value.isOn)

private bool m_GreenChannel;
[ToggleControl("Green")]
public Toggle greenChannel
public ToggleData greenChannel
get { return new Toggle(m_GreenChannel, channelCount > 1); }
get { return new ToggleData(m_GreenChannel, channelCount > 1); }
set
{
if (m_GreenChannel == value.isOn)

private bool m_BlueChannel;
[ToggleControl("Blue")]
public Toggle blueChannel
public ToggleData blueChannel
get { return new Toggle(m_BlueChannel, channelCount > 2); }
get { return new ToggleData(m_BlueChannel, channelCount > 2); }
set
{
if (m_BlueChannel == value.isOn)

private bool m_AlphaChannel;
[ToggleControl("Alpha")]
public Toggle alphaChannel
public ToggleData alphaChannel
get { return new Toggle(m_AlphaChannel, channelCount > 3); }
get { return new ToggleData(m_AlphaChannel, channelCount > 3); }
set
{
if (m_AlphaChannel == value.isOn)

16
com.unity.shadergraph/Editor/Data/Nodes/Channel/FlipNode.cs


private bool m_RedChannel;
[ToggleControl("Red")]
public Toggle redChannel
public ToggleData redChannel
get { return new Toggle(m_RedChannel, channelCount > 0); }
get { return new ToggleData(m_RedChannel, channelCount > 0); }
set
{
if (m_RedChannel == value.isOn)

private bool m_GreenChannel;
[ToggleControl("Green")]
public Toggle greenChannel
public ToggleData greenChannel
get { return new Toggle(m_GreenChannel, channelCount > 1); }
get { return new ToggleData(m_GreenChannel, channelCount > 1); }
set
{
if (m_GreenChannel == value.isOn)

private bool m_BlueChannel;
[ToggleControl("Blue")]
public Toggle blueChannel
public ToggleData blueChannel
get { return new Toggle(m_BlueChannel, channelCount > 2); }
get { return new ToggleData(m_BlueChannel, channelCount > 2); }
set
{
if (m_BlueChannel == value.isOn)

private bool m_AlphaChannel;
[ToggleControl("Alpha")]
public Toggle alphaChannel
public ToggleData alphaChannel
get { return new Toggle(m_AlphaChannel, channelCount > 3); }
get { return new ToggleData(m_AlphaChannel, channelCount > 3); }
set
{
if (m_AlphaChannel == value.isOn)

4
com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/BooleanNode.cs


}
[ToggleControl("")]
public Toggle value
public ToggleData value
get { return new Toggle(m_Value); }
get { return new ToggleData(m_Value); }
set
{
if (m_Value == value.isOn)

8
com.unity.shadergraph/Editor/Data/Nodes/UV/FlipbookNode.cs


private bool m_InvertX = false;
[ToggleControl("Invert X")]
public Toggle invertX
public ToggleData invertX
get { return new Toggle(m_InvertX); }
get { return new ToggleData(m_InvertX); }
set
{
if (m_InvertX == value.isOn)

private bool m_InvertY = true;
[ToggleControl("Invert Y")]
public Toggle invertY
public ToggleData invertY
get { return new Toggle(m_InvertY); }
get { return new ToggleData(m_InvertY); }
set
{
if (m_InvertY == value.isOn)

20
com.unity.shadergraph/Editor/Drawing/Controls/ToggleControl.cs


namespace UnityEditor.ShaderGraph.Drawing.Controls
{
[Serializable]
public struct Toggle
public struct ToggleData
public Toggle(bool on, bool enabled)
public ToggleData(bool on, bool enabled)
public Toggle(bool on)
public ToggleData(bool on)
{
isOn = on;
isEnabled = true;

m_PropertyInfo = propertyInfo;
AddStyleSheetPath("Styles/Controls/ToggleControlView");
if (propertyInfo.PropertyType != typeof(Toggle))
if (propertyInfo.PropertyType != typeof(ToggleData))
var value = (Toggle)m_PropertyInfo.GetValue(m_Node, null);
var value = (ToggleData)m_PropertyInfo.GetValue(m_Node, null);
var panel = new VisualElement { name = "togglePanel" };
if (!string.IsNullOrEmpty(label))
panel.Add(new Label(label));

public void OnNodeModified(ModificationScope scope)
{
var value = (Toggle)m_PropertyInfo.GetValue(m_Node, null);
var value = (ToggleData)m_PropertyInfo.GetValue(m_Node, null);
}
}
var value = (Toggle)m_PropertyInfo.GetValue(m_Node, null);
var value = (ToggleData)m_PropertyInfo.GetValue(m_Node, null);
value.isOn = !value.isOn;
m_PropertyInfo.SetValue(m_Node, value, null);
Dirty(ChangeType.Repaint);

2
com.unity.shadergraph/Editor/Drawing/Views/PBRSettingsView.cs


{
label.AddToClassList("label");
});
row.Add(new EnumField(AlphaMode.AdditiveBlend), (enumField) =>
row.Add(new EnumField(AlphaMode.Additive), (enumField) =>
{
enumField.value = m_Node.alphaMode;
enumField.OnValueChanged(ChangeAlphaMode);

2
com.unity.shadergraph/Editor/Drawing/Views/UnlitSettingsView.cs


label.AddToClassList("label");
});
row.Add(new EnumField(AlphaMode.AdditiveBlend), (enumField) =>
row.Add(new EnumField(AlphaMode.Additive), (enumField) =>
{
enumField.AddToClassList("enumcontainer");
enumField.value = m_Node.alphaMode;

正在加载...
取消
保存