From 4b073648c95ceb9d29a5395c2cf0d6bcd3499f0e Mon Sep 17 00:00:00 2001 From: Thor Brigsted Date: Wed, 25 Sep 2019 10:48:36 +0200 Subject: [PATCH] Added noodle hover highlight --- Scripts/Editor/NodeEditorAction.cs | 2 +- Scripts/Editor/NodeGraphEditor.cs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Scripts/Editor/NodeEditorAction.cs b/Scripts/Editor/NodeEditorAction.cs index 35fbdd1..cf5929d 100644 --- a/Scripts/Editor/NodeEditorAction.cs +++ b/Scripts/Editor/NodeEditorAction.cs @@ -19,7 +19,7 @@ namespace XNodeEditor { private bool IsHoveringNode { get { return hoveredNode != null; } } private bool IsHoveringReroute { get { return hoveredReroute.port != null; } } private XNode.Node hoveredNode = null; - [NonSerialized] private XNode.NodePort hoveredPort = null; + [NonSerialized] public XNode.NodePort hoveredPort = null; [NonSerialized] private XNode.NodePort draggedOutput = null; [NonSerialized] private XNode.NodePort draggedOutputTarget = null; [NonSerialized] private XNode.NodePort autoConnectOutput = null; diff --git a/Scripts/Editor/NodeGraphEditor.cs b/Scripts/Editor/NodeGraphEditor.cs index 431ebb2..e993abe 100644 --- a/Scripts/Editor/NodeGraphEditor.cs +++ b/Scripts/Editor/NodeGraphEditor.cs @@ -65,7 +65,9 @@ namespace XNodeEditor { /// Returned color is used to color noodles public virtual Color GetNoodleColor(XNode.NodePort output, XNode.NodePort input) { - return GetTypeColor(output.ValueType); + Color col = GetTypeColor(output.ValueType); + if (window.hoveredPort == output || window.hoveredPort == input) return Color.Lerp(col, Color.white, 0.8f); + return col; } /// Returned color is used to color ports