1
0
mirror of https://github.com/Siccity/xNode.git synced 2026-02-06 23:34:54 +08:00

Added Node.ClearInstancePorts

Fixed System.Exception
This commit is contained in:
Thor Brigsted 2017-12-19 19:18:35 +01:00
parent 247482d555
commit e21398cd19

View File

@ -84,6 +84,14 @@ namespace XNode {
port.ClearConnections();
ports.Remove(port.fieldName);
}
/// <summary> Removes all instance ports from the node </summary>
[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]);