浏览代码

Fixed MaterialNodeView.OnModified() after no-presenters change.

/main
damian 7 年前
当前提交
591d8820
共有 1 个文件被更改,包括 21 次插入7 次删除
  1. 28
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/MaterialNodeView.cs

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


m_Version++;
expanded = node.drawState.expanded;
/*
inputAnchors.RemoveAll(data => !slots.Contains(((GraphAnchorPresenter)data).slot));
outputAnchors.RemoveAll(data => !slots.Contains(((GraphAnchorPresenter)data).slot));
var anchorsToRemove = new List<VisualElement>();
foreach (var anchor in inputContainer.Children())
{
if (!slots.Contains(anchor.userData as ISlot))
anchorsToRemove.Add(anchor);
}
foreach (var ve in anchorsToRemove)
inputContainer.Remove(ve);
AddSlots(slots.Except(inputAnchors.Concat(outputAnchors).Select(data => ((GraphAnchorPresenter)data).slot)));
anchorsToRemove.Clear();
foreach (var anchor in outputContainer.Children())
{
if (!slots.Contains(anchor.userData as ISlot))
anchorsToRemove.Add(anchor);
}
foreach (var ve in anchorsToRemove)
outputContainer.Remove(ve);
inputAnchors.Sort((x, y) => slots.IndexOf(((GraphAnchorPresenter)x).slot) - slots.IndexOf(((GraphAnchorPresenter)y).slot));
outputAnchors.Sort((x, y) => slots.IndexOf(((GraphAnchorPresenter)x).slot) - slots.IndexOf(((GraphAnchorPresenter)y).slot));
AddSlots(slots.Except(inputContainer.Children().Concat(outputContainer.Children()).Select(data => data.userData as ISlot)));
inputContainer.Sort((x, y) => slots.IndexOf(x.userData as ISlot) - slots.IndexOf(y.userData as ISlot));
outputContainer.Sort((x, y) => slots.IndexOf(x.userData as ISlot) - slots.IndexOf(y.userData as ISlot));
*/
}
protected virtual IEnumerable<GraphControlPresenter> GetControlData()

正在加载...
取消
保存