From 38df17b58b29e33e9d1d06156bcd0784bd22024d Mon Sep 17 00:00:00 2001 From: Icarus <1375400884@qq.com> Date: Tue, 24 Sep 2019 13:50:04 +0800 Subject: [PATCH] =?UTF-8?q?!W=20=E7=BB=98=E5=88=B6=E4=B8=8D=E5=8F=AF?= =?UTF-8?q?=E8=A2=ABunity=E5=BA=8F=E5=88=97=E5=8C=96=E7=9A=84=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E7=AB=AF=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Scripts/Editor/NodeEditor.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Scripts/Editor/NodeEditor.cs b/Scripts/Editor/NodeEditor.cs index c923984..71529ff 100644 --- a/Scripts/Editor/NodeEditor.cs +++ b/Scripts/Editor/NodeEditor.cs @@ -52,10 +52,28 @@ namespace XNodeEditor { SerializedProperty iterator = serializedObject.GetIterator(); bool enterChildren = true; EditorGUIUtility.labelWidth = 84; + List _names = new List(); while (iterator.NextVisible(enterChildren)) { enterChildren = false; if (excludes.Contains(iterator.name)) continue; NodeEditorGUILayout.PropertyField(iterator, true); + _names.Add(iterator.name); + } + + //处理一下没被绘制的端口 + foreach (var port in target.Ports) + { + //动态的跳过 + if (port.IsDynamic) + { + continue; + } + + //不受unity序列化支持,但是被标记为了输入或输出 + if (!_names.Contains(port.fieldName)) + { + NodeEditorGUILayout.PortField(port); + } } #endif