From fdd42a827482f967fd93c716fae883328c517321 Mon Sep 17 00:00:00 2001 From: Icarus <1375400884@qq.com> Date: Wed, 25 Sep 2019 23:45:57 +0800 Subject: [PATCH] =?UTF-8?q?!W=20=E8=BE=93=E5=87=BA=E7=AB=AF=E5=8F=A3?= =?UTF-8?q?=E7=B4=A2=E5=BC=95=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Scripts/Editor/NodeEditorGUILayout.cs | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/Scripts/Editor/NodeEditorGUILayout.cs b/Scripts/Editor/NodeEditorGUILayout.cs index 6648c2d..770282e 100644 --- a/Scripts/Editor/NodeEditorGUILayout.cs +++ b/Scripts/Editor/NodeEditorGUILayout.cs @@ -197,7 +197,31 @@ namespace XNodeEditor { Color backgroundColor = editor.GetTint(); Color col = NodeEditorWindow.current.graphEditor.GetPortColor(port); DrawPortHandle(rect, backgroundColor, col); - + + //当选择节点时显示所有的输入点索引 + if (port.direction == XNode.NodePort.IO.Output) + { + if (port.Connection != null) + { + if (port.Connection.node == Selection.activeObject) + { + var dCol = GUI.color; + var fontStyle = EditorStyles.label.fontStyle; + var textCol = Color.white - col; + textCol.a = 1; + var index = port.Connection.GetConnectionIndex(port); + EditorStyles.label.fontStyle = FontStyle.Bold; + GUI.contentColor = textCol; + { + EditorGUI.LabelField(new Rect( rect.position + new Vector2(rect.size.x / 4 - 0.5f,0), rect.size), + index.ToString()); + } + GUI.contentColor = dCol; + EditorStyles.label.fontStyle = fontStyle; + } + } + } + // Register the handle position Vector2 portPos = rect.center; NodeEditor.portPositions[port] = portPos;