From 0602d3fccf206cc60b9244894b5e76f7744b67fa Mon Sep 17 00:00:00 2001 From: Icarus <1375400884@qq.com> Date: Tue, 24 Sep 2019 18:16:02 +0800 Subject: [PATCH] =?UTF-8?q?!W=20=E5=8A=A8=E6=80=81Port=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E4=BA=86=E4=B8=80=E4=B8=AA=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Scripts/Editor/NodeEditorGUI.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Scripts/Editor/NodeEditorGUI.cs b/Scripts/Editor/NodeEditorGUI.cs index 6546f6f..29df4cd 100644 --- a/Scripts/Editor/NodeEditorGUI.cs +++ b/Scripts/Editor/NodeEditorGUI.cs @@ -112,6 +112,10 @@ namespace XNodeEditor { void ShowPortContextMenu(XNode.NodePort hoveredPort) { GenericMenu contextMenu = new GenericMenu(); contextMenu.AddItem(new GUIContent("Clear Connections"), false, () => hoveredPort.ClearConnections()); + if (hoveredPort.IsDynamic) + { + contextMenu.AddItem(new GUIContent("Remove"), false, () => hoveredPort.node.RemoveDynamicPort(hoveredPort)); + } contextMenu.DropDown(new Rect(Event.current.mousePosition, Vector2.zero)); if (NodeEditorPreferences.GetSettings().autoSave) AssetDatabase.SaveAssets(); }