diff --git a/Scripts/Editor/NodeEditor.cs b/Scripts/Editor/NodeEditor.cs index d222f9e..1fffc66 100644 --- a/Scripts/Editor/NodeEditor.cs +++ b/Scripts/Editor/NodeEditor.cs @@ -64,6 +64,7 @@ namespace XNodeEditor { // Iterate through instance ports and draw them in the order in which they are serialized foreach(XNode.NodePort instancePort in target.InstancePorts) { + if (NodeEditorGUILayout.IsInstancePortListPort(instancePort)) continue; NodeEditorGUILayout.PortField(instancePort); } diff --git a/Scripts/Editor/NodeEditorGUILayout.cs b/Scripts/Editor/NodeEditorGUILayout.cs index 7cc1a21..b2ac5e8 100644 --- a/Scripts/Editor/NodeEditorGUILayout.cs +++ b/Scripts/Editor/NodeEditorGUILayout.cs @@ -254,6 +254,18 @@ namespace XNodeEditor { GUI.color = col; } + /// Is this port part of an InstancePortList? + public static bool IsInstancePortListPort(XNode.NodePort port) { + string[] parts = port.fieldName.Split(' '); + if (parts.Length != 2) return false; + Dictionary cache; + if (reorderableListCache.TryGetValue(port.node, out cache)) { + ReorderableList list; + if (cache.TryGetValue(parts[0], out list)) return true; + } + return false; + } + /// Draw an editable list of instance ports. Port names are named as "[fieldName] [index]" /// Supply a list for editable values /// Value type of added instance ports