diff --git a/Scripts/Editor/NodeEditorAction.cs b/Scripts/Editor/NodeEditorAction.cs index a2d4257..cdfdc4f 100644 --- a/Scripts/Editor/NodeEditorAction.cs +++ b/Scripts/Editor/NodeEditorAction.cs @@ -274,13 +274,13 @@ namespace XNodeEditor { ShowPortContextMenu(hoveredPort); } else if (IsHoveringNode && IsHoveringTitle(hoveredNode)) { if (!Selection.Contains(hoveredNode)) SelectNode(hoveredNode, false); - autoConnectOutput = null; + autoConnectOutput = null; GenericMenu menu = new GenericMenu(); NodeEditor.GetEditor(hoveredNode, this).AddContextMenuItems(menu); menu.DropDown(new Rect(Event.current.mousePosition, Vector2.zero)); e.Use(); // Fixes copy/paste context menu appearing in Unity 5.6.6f2 - doesn't occur in 2018.3.2f1 Probably needs to be used in other places. } else if (!IsHoveringNode) { - autoConnectOutput = null; + autoConnectOutput = null; GenericMenu menu = new GenericMenu(); graphEditor.AddContextMenuItems(menu); menu.DropDown(new Rect(Event.current.mousePosition, Vector2.zero)); diff --git a/Scripts/Editor/NodeEditorGUI.cs b/Scripts/Editor/NodeEditorGUI.cs index 075bd07..c58b2aa 100644 --- a/Scripts/Editor/NodeEditorGUI.cs +++ b/Scripts/Editor/NodeEditorGUI.cs @@ -127,7 +127,7 @@ namespace XNodeEditor { for (int i = 0; i < length - 1; i++) { Vector2 inputTangent = Vector2.left; // Cached most variables that repeat themselves here to avoid so many indexer calls :p - Vector2 point_a = windowPoints[i]; + Vector2 point_a = windowPoints[i]; Vector2 point_b = windowPoints[i + 1]; float dist_ab = Vector2.Distance(point_a, point_b); if (i == 0) outputTangent = Vector2.right * dist_ab * 0.01f * zoom; @@ -142,8 +142,7 @@ namespace XNodeEditor { p = new Vector2(-p.y, p.x) * Mathf.Sign(side) * tangentLength; inputTangent = p; - } - else { + } else { inputTangent = Vector2.left * dist_ab * 0.01f * zoom; } @@ -155,7 +154,7 @@ namespace XNodeEditor { int division = Mathf.RoundToInt(.1f * dist_ab) + 3; Vector3[] points = Handles.MakeBezierPoints(point_a, point_b, tangent_a, tangent_b, division); // Coloring and bezier drawing. - for (int j = 0; j < points.Length - 1; j++) { + for (int j = 0; j < points.Length - 1; j++) { Handles.color = gradient.Evaluate((j + 1f) / (points.Length)); Handles.DrawAAPolyLine(bezier_width, points[j], points[j + 1]); } @@ -170,7 +169,7 @@ namespace XNodeEditor { int line_width = 5; // Draws the line with the coloring. Vector2 prev_point = point_a; - for (float j = 0; j < 1; j += 10f / Vector2.Distance(point_a, point_b)) { + for (float j = 0; j < 1; j += 10f / Vector2.Distance(point_a, point_b)) { Vector2 lerp = Vector2.Lerp(point_a, point_b, j); Handles.color = gradient.Evaluate(j); Handles.DrawAAPolyLine(line_width, prev_point, lerp); @@ -239,7 +238,7 @@ namespace XNodeEditor { Color portColor = graphEditor.GetPortColor(output); for (int k = 0; k < output.ConnectionCount; k++) { XNode.NodePort input = output.GetConnection(k); - + Gradient noodleGradient = graphEditor.GetNoodleGradient(output, input); // Error handling diff --git a/Scripts/Editor/NodeGraphEditor.cs b/Scripts/Editor/NodeGraphEditor.cs index d85df32..91fba43 100644 --- a/Scripts/Editor/NodeGraphEditor.cs +++ b/Scripts/Editor/NodeGraphEditor.cs @@ -73,8 +73,8 @@ namespace XNodeEditor { } Gradient grad = new Gradient(); grad.SetKeys( - new GradientColorKey[] { new GradientColorKey(a, 0f), new GradientColorKey(b, 1f) }, - new GradientAlphaKey[] { new GradientAlphaKey(1f, 0f), new GradientAlphaKey(1f, 1f) } + new GradientColorKey[] { new GradientColorKey(a, 0f), new GradientColorKey(b, 1f) }, + new GradientAlphaKey[] { new GradientAlphaKey(1f, 0f), new GradientAlphaKey(1f, 1f) } ); return grad; }