mirror of
https://github.com/Siccity/xNode.git
synced 2026-03-26 22:49:02 +08:00
deleted the annoying parameter
This commit is contained in:
parent
01ca8e255f
commit
36c5c3f922
@ -42,7 +42,7 @@ namespace XNodeEditor {
|
||||
}
|
||||
|
||||
/// <summary> Add items for the context menu when right-clicking this node. Override to add custom menu items. </summary>
|
||||
public virtual void AddContextMenuItems(GenericMenu menu, GenericMenu.MenuFunction2 call = default(GenericMenu.MenuFunction2)) {
|
||||
public virtual void AddContextMenuItems(GenericMenu menu) {
|
||||
Vector2 pos = NodeEditorWindow.current.WindowToGridPosition(Event.current.mousePosition);
|
||||
for (int i = 0; i < NodeEditorReflection.nodeTypes.Length; i++) {
|
||||
Type type = NodeEditorReflection.nodeTypes[i];
|
||||
@ -50,15 +50,10 @@ namespace XNodeEditor {
|
||||
//Get node context menu path
|
||||
string path = GetNodeMenuName(type);
|
||||
if (string.IsNullOrEmpty(path)) continue;
|
||||
|
||||
if (call != null)
|
||||
menu.AddItem(new GUIContent(path), false, () => {
|
||||
CreateNode(type, pos);
|
||||
call(null);
|
||||
});
|
||||
else
|
||||
|
||||
menu.AddItem(new GUIContent(path), false, () => {
|
||||
CreateNode(type, pos);
|
||||
if(!NodeEditorWindow.stoppedDraggingPort) NodeEditorWindow.current.ConnectOnCreate();
|
||||
});
|
||||
}
|
||||
menu.AddSeparator("");
|
||||
@ -136,4 +131,4 @@ namespace XNodeEditor {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user