private bool Valid(NodePort port, out BaseFlow flowNode) { foreach (var item in port.GetConnections()) { if (item.node != null && item.node is IValidatable validatable) { if (validatable.Valid) { NodePort outPort = item.node.GetOutputPort("Out"); if (outPort.IsConnected) { NodePort connection = outPort.GetConnection(0); if (connection.node is BaseFlow) { flowNode = connection.node as BaseFlow; return(true); } else { Debug.LogError("Attached node is not a FlowNode"); } } else { Debug.LogError("Rule 'Out' not connected to FlowNode"); } } } } flowNode = null; return(false); }
public bool Validate(out BaseFlow flowNode) { return(Valid(rulePort, out flowNode)); }