浏览代码

Update slot names on topological change

/main
Tim Cooper 7 年前
当前提交
f9ccf9f9
共有 1 个文件被更改,包括 13 次插入7 次删除
  1. 20
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/MaterialNodeView.cs

20
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/MaterialNodeView.cs


foreach (var ve in anchorsToRemove)
outputContainer.Remove(ve);
foreach (var port in inputContainer.Union(outputContainer).OfType<Port>())
{
var slot = (MaterialSlot)port.userData;
port.portName = slot.displayName;
}
AddSlots(slots.Except(inputContainer.Children().Concat(outputContainer.Children()).Select(data => data.userData as MaterialSlot)));
if (inputContainer.childCount > 0)

if (slot.hidden)
continue;
var anchor = InstantiatePort(Orientation.Horizontal, slot.isInputSlot ? Direction.Input : Direction.Output, typeof(Vector4));
anchor.capabilities &= ~Capabilities.Movable;
anchor.portName = slot.displayName;
anchor.userData = slot;
var port = InstantiatePort(Orientation.Horizontal, slot.isInputSlot ? Direction.Input : Direction.Output, typeof(Vector4));
port.capabilities &= ~Capabilities.Movable;
port.portName = slot.displayName;
port.userData = slot;
outputContainer.Add(anchor);
outputContainer.Add(port);
inputContainer.Add(anchor);
inputContainer.Add(port);
m_Attachers.Add(new Attacher(portInputView, anchor, SpriteAlignment.LeftCenter) { distance = 0f });
m_Attachers.Add(new Attacher(portInputView, port, SpriteAlignment.LeftCenter) { distance = 0f });
}
}
}

正在加载...
取消
保存