From 29b9841014a3105e42a31c2434850ccaedd773d9 Mon Sep 17 00:00:00 2001 From: Thor Brigsted Date: Sun, 29 Oct 2017 21:11:39 +0100 Subject: [PATCH] Fixed bug where a null node would stop node drawing --- Scripts/Editor/NodeEditorGUI.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Scripts/Editor/NodeEditorGUI.cs b/Scripts/Editor/NodeEditorGUI.cs index 9698df4..4256666 100644 --- a/Scripts/Editor/NodeEditorGUI.cs +++ b/Scripts/Editor/NodeEditorGUI.cs @@ -150,14 +150,16 @@ public partial class NodeEditorWindow { Vector2 mousePos = Event.current.mousePosition; - if (e.type != EventType.Layout) { hoveredNode = null; hoveredPort = null; } - foreach (Node node in graph.nodes) { - if (node == null) return; + for (int n = 0; n < graph.nodes.Count; n++) { + while (graph.nodes[n] == null) graph.nodes.RemoveAt(n); + if (n >= graph.nodes.Count) return; + Node node = graph.nodes[n]; + NodeEditor nodeEditor = GetNodeEditor(node.GetType()); nodeEditor.target = node; @@ -213,6 +215,7 @@ public partial class NodeEditorWindow { GUILayout.EndArea(); } + EndZoomed(position, zoom); //If a change in hash is detected in the selected node, call OnValidate method.