From 84c1e9e14dfd50eda17a4b0a8ca0ab34d2dccc5a Mon Sep 17 00:00:00 2001 From: Icarus <1375400884@qq.com> Date: Tue, 3 Dec 2019 18:42:38 +0800 Subject: [PATCH] !TX todo --- Scripts/Editor/NodeEditorAction.cs | 6 +++++- Scripts/Editor/NodeEditorGUI.cs | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Scripts/Editor/NodeEditorAction.cs b/Scripts/Editor/NodeEditorAction.cs index c919c9b..47a6a7f 100644 --- a/Scripts/Editor/NodeEditorAction.cs +++ b/Scripts/Editor/NodeEditorAction.cs @@ -207,7 +207,11 @@ namespace XNodeEditor { //If connection is valid, save it if (draggedOutputTarget != null) { XNode.Node node = draggedOutputTarget.node; - if (graph.nodes.Count != 0) draggedOutput.Connect(draggedOutputTarget); + if (graph.nodes.Count != 0) + { + //todo Connect Callback 2019.12.3 18点38分 + draggedOutput.Connect(draggedOutputTarget); + } // ConnectionIndex can be -1 if the connection is removed instantly after creation int connectionIndex = draggedOutput.GetConnectionIndex(draggedOutputTarget); diff --git a/Scripts/Editor/NodeEditorGUI.cs b/Scripts/Editor/NodeEditorGUI.cs index a734bd8..e6359c7 100644 --- a/Scripts/Editor/NodeEditorGUI.cs +++ b/Scripts/Editor/NodeEditorGUI.cs @@ -125,7 +125,11 @@ namespace XNodeEditor { /// Show right-click context menu for hovered port void ShowPortContextMenu(XNode.NodePort hoveredPort) { GenericMenu contextMenu = new GenericMenu(); - contextMenu.AddItem(new GUIContent("Clear Connections"), false, () => hoveredPort.ClearConnections()); + contextMenu.AddItem(new GUIContent("Clear Connections"), false, () => + { + //todo Remove Connect Callback 2019.12.3 18点41分 + hoveredPort.ClearConnections(); + }); if (hoveredPort.IsDynamic) { contextMenu.AddItem(new GUIContent("Remove"), false, () => hoveredPort.node.RemoveDynamicPort(hoveredPort));