浏览代码

Remove unnecessary serialized properties

/main
Matt Dean 7 年前
当前提交
67827c5c
共有 2 个文件被更改,包括 0 次插入8 次删除
  1. 4
      com.unity.shadergraph/Editor/Drawing/Controls/GradientControl.cs
  2. 4
      com.unity.shadergraph/Editor/Drawing/Views/Slots/GradientSlotControlView.cs

4
com.unity.shadergraph/Editor/Drawing/Controls/GradientControl.cs


[SerializeField]
SerializedObject m_SerializedObject;
[SerializeField]
SerializedProperty m_SerializedProperty;
public GradientControlView(string label, AbstractMaterialNode node, PropertyInfo propertyInfo)
{
m_Node = node;

m_GradientObject = ScriptableObject.CreateInstance<GradientObject>();
m_GradientObject.gradient = new Gradient();
m_SerializedObject = new SerializedObject(m_GradientObject);
m_SerializedProperty = m_SerializedObject.FindProperty("gradient");
var gradient = (Gradient)m_PropertyInfo.GetValue(m_Node, null);
m_GradientObject.gradient.SetKeys(gradient.colorKeys, gradient.alphaKeys);

4
com.unity.shadergraph/Editor/Drawing/Views/Slots/GradientSlotControlView.cs


[SerializeField]
SerializedObject m_SerializedObject;
[SerializeField]
SerializedProperty m_SerializedProperty;
public GradientSlotControlView(GradientInputMaterialSlot slot)
{
m_Slot = slot;

m_GradientObject.gradient = new Gradient();
m_SerializedObject = new SerializedObject(m_GradientObject);
m_SerializedProperty = m_SerializedObject.FindProperty("gradient");
m_GradientObject.gradient.SetKeys(m_Slot.value.colorKeys, m_Slot.value.alphaKeys);
m_GradientObject.gradient.mode = m_Slot.value.mode;

正在加载...
取消
保存