浏览代码

Handle remove events from GraphView

/main
Peter Bay Bastian 7 年前
当前提交
e408be90
共有 1 个文件被更改,包括 16 次插入0 次删除
  1. 16
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/GraphEditorView.cs

16
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/GraphEditorView.cs


GraphViewChange GraphViewChanged(GraphViewChange graphViewChange)
{
if (graphViewChange.elementsToRemove != null)
{
foreach (var element in graphViewChange.elementsToRemove)
{
m_Graph.owner.RegisterCompleteObjectUndo("Delete");
var nodeView = element as MaterialNodeView;
if (nodeView != null)
m_Graph.RemoveNode(nodeView.node);
var edgeView = element as Edge;
if (edgeView != null)
m_Graph.RemoveEdge(edgeView.userData as IEdge);
}
graphViewChange.elementsToRemove.Clear();
}
if (graphViewChange.edgesToCreate != null)
{
foreach (var edge in graphViewChange.edgesToCreate)

正在加载...
取消
保存