From 7c3c106eeb964df7a10b59b1fb97a464ede5dd5f Mon Sep 17 00:00:00 2001 From: Icarus <1375400884@qq.com> Date: Wed, 25 Sep 2019 16:59:43 +0800 Subject: [PATCH] =?UTF-8?q?!W=20=E5=8A=A0=E4=BA=86=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E5=BD=93=E5=89=8DGroup=E6=89=80=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E7=9A=84=E6=89=80=E6=9C=89=E8=8A=82=E7=82=B9=E5=8A=9F?= =?UTF-8?q?=E8=83=BD,=E7=94=A8=E4=BA=8E=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Scripts/Editor/NodeGraphEditor.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Scripts/Editor/NodeGraphEditor.cs b/Scripts/Editor/NodeGraphEditor.cs index bdd4fa0..7b706fa 100644 --- a/Scripts/Editor/NodeGraphEditor.cs +++ b/Scripts/Editor/NodeGraphEditor.cs @@ -60,6 +60,24 @@ namespace XNodeEditor { if (NodeEditorWindow.copyBuffer != null && NodeEditorWindow.copyBuffer.Length > 0) menu.AddItem(new GUIContent("Paste"), false, () => NodeEditorWindow.current.PasteNodes(pos)); else menu.AddDisabledItem(new GUIContent("Paste")); menu.AddItem(new GUIContent("Preferences"), false, () => NodeEditorReflection.OpenPreferences()); + menu.AddItem(new GUIContent("创建所有的节点 ---> 测试用"), false, () => + { + for (int i = 0; i < NodeEditorReflection.nodeTypes.Length; i++) + { + Type type = NodeEditorReflection.nodeTypes[i]; + + //Get node context menu path + string path = GetNodeMenuName(type); + //当前Group 不支持该节点跳过 + if (string.IsNullOrEmpty(path)) + { + continue; + } + + XNode.Node node = CreateNode(type, pos); + NodeEditorWindow.current.AutoConnect(node); + } + }); menu.AddCustomContextMenuItems(target); }