浏览代码

[FIX] #271 Making sure that the new inports are modifiable after saving the subgraph

/main
Martin Thorzen 7 年前
当前提交
166af912
共有 3 个文件被更改,包括 28 次插入15 次删除
  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 => Equals(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();
}
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);
Recreate();
}
}
m_Container.visible = m_EdgeControl.visible = m_Control != null;
void Recreate()
{
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);
m_Container.visible = m_EdgeControl.visible = m_Control != null;
}
public void Dispose()

正在加载...
取消
保存