mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-20 09:16:01 +08:00
Added overload for RemoveInstancePort. Removed return bool.
This commit is contained in:
parent
66de07e1a7
commit
247482d555
@ -72,12 +72,17 @@ namespace XNode {
|
|||||||
return port;
|
return port;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool RemoveInstancePort(string fieldName) {
|
/// <summary> Remove an instance port from the node </summary>
|
||||||
NodePort port = GetPort(fieldName);
|
public void RemoveInstancePort(string fieldName) {
|
||||||
if (port == null || port.IsStatic) return false;
|
RemoveInstancePort(GetPort(fieldName));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary> Remove an instance port from the node </summary>
|
||||||
|
public void RemoveInstancePort(NodePort port) {
|
||||||
|
if (port == null) throw new ArgumentNullException("port");
|
||||||
|
else if (port.IsStatic) throw new ArgumentException("cannot remove static port");
|
||||||
port.ClearConnections();
|
port.ClearConnections();
|
||||||
ports.Remove(fieldName);
|
ports.Remove(port.fieldName);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user