diff --git a/Scripts/Node.cs b/Scripts/Node.cs index e22b78f..9cc7bb3 100644 --- a/Scripts/Node.cs +++ b/Scripts/Node.cs @@ -84,6 +84,14 @@ namespace XNode { port.ClearConnections(); ports.Remove(port.fieldName); } + + /// Removes all instance ports from the node + [ContextMenu("Clear instance ports")] + public void ClearInstancePorts() { + foreach (NodePort port in InstancePorts) { + RemoveInstancePort(port); + } + } #endregion #region Ports @@ -229,7 +237,7 @@ namespace XNode { this.Clear(); if (keys.Count != values.Count) - throw new System.Exception(string.Format("there are {0} keys and {1} values after deserialization. Make sure that both key and value types are serializable.")); + throw new System.Exception("there are " + keys.Count + " keys and " + values.Count + " values after deserialization. Make sure that both key and value types are serializable."); for (int i = 0; i < keys.Count; i++) this.Add(keys[i], values[i]);