private void AddNodeConnection(NodeConnection connection) { // Check if we already have that connection. foreach (NodeConnection c in connections) { // Check if we trying to make already existing connection. if (c.inPoint == connection.inPoint && c.outPoint == connection.outPoint) { return; } // If they have same parent and different actor id-s, then avoid connection and show error. if (c.outPoint.ownerNode == connection.outPoint.ownerNode && c.inPoint.ownerNode.actorID != connection.inPoint.ownerNode.actorID) { EditorUtility.DisplayDialog("ERROR", "Nodes of the same parent node must have same actor IDs!", "OK"); return; } } connections.Add(connection); }
private void RemoveNodeConnection(NodeConnection connection) { connections.Remove(connection); }