1
0
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:
Thor Brigsted 2018-02-09 14:29:18 +01:00
parent b787b57eb3
commit 2a951a3002

View File

@ -9,8 +9,15 @@ namespace XNode {
public enum IO { Input, Output }
public int ConnectionCount { get { return connections.Count; } }
/// <summary> Return the first connection </summary>
public NodePort Connection { get { return connections.Count > 0 ? connections[0].Port : null; } }
/// <summary> Return the first non-null connection </summary>
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 Node.ConnectionType connectionType { get { return _connectionType; } }