浏览代码

Merge pull request #281 from Unity-Technologies/fix-subshader-property-update

[FIX]  for issue #271
/main
GitHub 7 年前
当前提交
5d5824ef
共有 3 个文件被更改,包括 27 次插入16 次删除
  1. 1
      com.unity.shadergraph/Editor/Drawing/MaterialGraphEditWindow.cs
  2. 3
      com.unity.shadergraph/Editor/Drawing/Views/MaterialNodeView.cs
  3. 39
      com.unity.shadergraph/Editor/Drawing/Views/PortInputView.cs

1
com.unity.shadergraph/Editor/Drawing/MaterialGraphEditWindow.cs


AssetDatabase.ImportAsset(path);
}
private void Rebuild()
{
if (graphObject != null && graphObject.graph != null)

3
com.unity.shadergraph/Editor/Drawing/Views/MaterialNodeView.cs


else
{
port.slot = newSlot;
var portInputView = m_PortInputContainer.OfType<PortInputView>().FirstOrDefault(x => x.slot.id == currentSlot.id);
portInputView.UpdateSlot(newSlot);
slots.Remove(newSlot);
}
}

39
com.unity.shadergraph/Editor/Drawing/Views/PortInputView.cs


m_EdgeControl.outputColor = edgeColor;
}
public void UpdateSlot(MaterialSlot newSlot)
{
m_Slot = newSlot;
Recreate();
}
Recreate();
}
void Recreate()
{
RemoveFromClassList("type" + m_SlotType);
m_SlotType = slot.concreteValueType;
AddToClassList("type" + m_SlotType);
if (m_Control != null)
RemoveFromClassList("type" + m_SlotType);
m_SlotType = slot.concreteValueType;
AddToClassList("type" + m_SlotType);
if (m_Control != null)
{
var disposable = m_Control as IDisposable;
if (disposable != null)
disposable.Dispose();
m_Container.Remove(m_Control);
}
m_Control = slot.InstantiateControl();
if (m_Control != null)
m_Container.Insert(0, m_Control);
var disposable = m_Control as IDisposable;
if (disposable != null)
disposable.Dispose();
m_Container.Remove(m_Control);
}
m_Control = slot.InstantiateControl();
if (m_Control != null)
m_Container.Insert(0, m_Control);
m_Container.visible = m_EdgeControl.visible = m_Control != null;
}
m_Container.visible = m_EdgeControl.visible = m_Control != null;
}
public void Dispose()

正在加载...
取消
保存