mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-20 17:26:02 +08:00
Fixed Connection returning null when non-nulls exist.
This commit is contained in:
parent
b787b57eb3
commit
2a951a3002
@ -9,8 +9,15 @@ namespace XNode {
|
|||||||
public enum IO { Input, Output }
|
public enum IO { Input, Output }
|
||||||
|
|
||||||
public int ConnectionCount { get { return connections.Count; } }
|
public int ConnectionCount { get { return connections.Count; } }
|
||||||
/// <summary> Return the first connection </summary>
|
/// <summary> Return the first non-null connection </summary>
|
||||||
public NodePort Connection { get { return connections.Count > 0 ? connections[0].Port : null; } }
|
public NodePort Connection {
|
||||||
|
get {
|
||||||
|
for (int i = 0; i < connections.Count; i++) {
|
||||||
|
if (connections[i] != null) return connections[i].Port;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public IO direction { get { return _direction; } }
|
public IO direction { get { return _direction; } }
|
||||||
public Node.ConnectionType connectionType { get { return _connectionType; } }
|
public Node.ConnectionType connectionType { get { return _connectionType; } }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user