From 92ebd5953999d79b0231a054a6439f076c1509f9 Mon Sep 17 00:00:00 2001 From: Simon Rodriguez Date: Tue, 12 Nov 2019 23:19:51 +0100 Subject: [PATCH] reuse the list of grid points instead of creating a new one for each node->port --- Scripts/Editor/NodeEditorGUI.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Scripts/Editor/NodeEditorGUI.cs b/Scripts/Editor/NodeEditorGUI.cs index 5ff178f..1feec0e 100644 --- a/Scripts/Editor/NodeEditorGUI.cs +++ b/Scripts/Editor/NodeEditorGUI.cs @@ -271,6 +271,8 @@ namespace XNodeEditor { List selection = preBoxSelectionReroute != null ? new List(preBoxSelectionReroute) : new List(); hoveredReroute = new RerouteReference(); + List gridPoints = new List(2); + Color col = GUI.color; foreach (XNode.Node node in graph.nodes) { //If a null node is found, return. This can happen if the nodes associated script is deleted. It is currently not possible in Unity to delete a null asset. @@ -299,7 +301,7 @@ namespace XNodeEditor { List reroutePoints = output.GetReroutePoints(k); - List gridPoints = new List(); + gridPoints.Clear(); gridPoints.Add(fromRect.center); gridPoints.AddRange(reroutePoints); gridPoints.Add(toRect.center);