mirror of
https://github.com/Siccity/xNode.git
synced 2026-03-26 22:49:02 +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;
|
||||
}
|
||||
|
||||
public bool RemoveInstancePort(string fieldName) {
|
||||
NodePort port = GetPort(fieldName);
|
||||
if (port == null || port.IsStatic) return false;
|
||||
/// <summary> Remove an instance port from the node </summary>
|
||||
public void RemoveInstancePort(string fieldName) {
|
||||
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();
|
||||
ports.Remove(fieldName);
|
||||
return true;
|
||||
ports.Remove(port.fieldName);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user