From 1438b1463a685b8a39215d68d44194a2b8873b58 Mon Sep 17 00:00:00 2001 From: Thor Brigsted Date: Fri, 6 Sep 2019 18:12:13 +0200 Subject: [PATCH] Fixed formatting and compile error --- Scripts/Editor/NodeEditorAction.cs | 6 +++--- Scripts/Editor/NodeGraphEditor.cs | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Scripts/Editor/NodeEditorAction.cs b/Scripts/Editor/NodeEditorAction.cs index e10c29d..f038986 100644 --- a/Scripts/Editor/NodeEditorAction.cs +++ b/Scripts/Editor/NodeEditorAction.cs @@ -503,7 +503,7 @@ namespace XNodeEditor { if (stoppedDraggingPort) { if (draggedPort != null && draggedPort.IsOutput) { GenericMenu menu = new GenericMenu(); - graphEditor.AddContextMenuItems(menu, ConnectOnCreate); + graphEditor.AddContextMenuItems(menu); menu.DropDown(new Rect(Event.current.mousePosition, Vector2.zero)); } stoppedDraggingPort = false; @@ -528,7 +528,7 @@ namespace XNodeEditor { Rect windowRect = new Rect(nodePos, new Vector2(width / zoom, 30 / zoom)); return windowRect.Contains(mousePos); } - + public void ConnectOnCreate() { if (graph.nodes.Last().Ports.Where(r => r.IsInput == true).Any(r => r.ValueType == draggedPort.ValueType)) draggedPort.Connect(graph.nodes.Last().Ports.Where(r => r.IsInput == true).Where(r => r.ValueType == draggedPort.ValueType).ToArray() [0]); @@ -536,4 +536,4 @@ namespace XNodeEditor { draggedPort.Connect(graph.nodes.Last().Ports.Where(r => r.IsInput == true).ToArray() [0]); } } -} +} \ No newline at end of file diff --git a/Scripts/Editor/NodeGraphEditor.cs b/Scripts/Editor/NodeGraphEditor.cs index 743db98..f98935e 100644 --- a/Scripts/Editor/NodeGraphEditor.cs +++ b/Scripts/Editor/NodeGraphEditor.cs @@ -50,11 +50,11 @@ namespace XNodeEditor { //Get node context menu path string path = GetNodeMenuName(type); if (string.IsNullOrEmpty(path)) continue; - - menu.AddItem(new GUIContent(path), false, () => { - CreateNode(type, pos); - if(!NodeEditorWindow.stoppedDraggingPort) NodeEditorWindow.current.ConnectOnCreate(); - }); + + menu.AddItem(new GUIContent(path), false, () => { + CreateNode(type, pos); + if (!NodeEditorWindow.stoppedDraggingPort) NodeEditorWindow.current.ConnectOnCreate(); + }); } menu.AddSeparator(""); if (NodeEditorWindow.copyBuffer != null && NodeEditorWindow.copyBuffer.Length > 0) menu.AddItem(new GUIContent("Paste"), false, () => NodeEditorWindow.current.PasteNodes(pos)); @@ -115,7 +115,7 @@ namespace XNodeEditor { [AttributeUsage(AttributeTargets.Class)] public class CustomNodeGraphEditorAttribute : Attribute, - XNodeEditor.Internal.NodeEditorBase.INodeEditorAttrib { + XNodeEditor.Internal.NodeEditorBase.INodeEditorAttrib { private Type inspectedType; public string editorPrefsKey; /// Tells a NodeGraphEditor which Graph type it is an editor for @@ -131,4 +131,4 @@ namespace XNodeEditor { } } } -} +} \ No newline at end of file