mirror of
https://github.com/Siccity/xNode.git
synced 2026-03-26 22:49:02 +08:00
!W 加了一个创建当前Group所支持的所有节点功能,用于调试
This commit is contained in:
parent
25514fce96
commit
7c3c106eeb
@ -60,6 +60,24 @@ namespace XNodeEditor {
|
|||||||
if (NodeEditorWindow.copyBuffer != null && NodeEditorWindow.copyBuffer.Length > 0) menu.AddItem(new GUIContent("Paste"), false, () => NodeEditorWindow.current.PasteNodes(pos));
|
if (NodeEditorWindow.copyBuffer != null && NodeEditorWindow.copyBuffer.Length > 0) menu.AddItem(new GUIContent("Paste"), false, () => NodeEditorWindow.current.PasteNodes(pos));
|
||||||
else menu.AddDisabledItem(new GUIContent("Paste"));
|
else menu.AddDisabledItem(new GUIContent("Paste"));
|
||||||
menu.AddItem(new GUIContent("Preferences"), false, () => NodeEditorReflection.OpenPreferences());
|
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);
|
menu.AddCustomContextMenuItems(target);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user