1
0
mirror of https://github.com/Siccity/xNode.git synced 2025-12-20 09:16:01 +08:00

Added noodle hover highlight

This commit is contained in:
Thor Brigsted 2019-09-25 10:48:36 +02:00
parent 979bd5f7cf
commit 4b073648c9
2 changed files with 4 additions and 2 deletions

View File

@ -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;

View File

@ -65,7 +65,9 @@ namespace XNodeEditor {
/// <summary> Returned color is used to color noodles </summary>
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;
}
/// <summary> Returned color is used to color ports </summary>