public void DisconnectEnd() { if (End == null) { return; } End.RemoveConnection(this); End = null; }
public static void FixNodeInput(InputPort input) { Node node = input.Node; if (node == null) { Debug.LogWarning("Null node on attempt to fix input port."); return; } node.PortHandler.inputNode.InputPort = input; }
public static bool AttemptToConnect(Connection connection, InputPort input, OutputPort output) { bool success = CanBeConnected(input, output); if (success) { Connect(connection, input, output); } //Debug.Log("Connection success: " + success.ToString()); return(success); }
public static void ReplaceInputPort(this IInput inputNode, ref InputPort oldPort, InputPort value) { //if (oldPort != null) //{ // //oldPort.GetConnections().ForEach(c => // //{ // // if (c != null) c.End = value; // //}); // oldPort.Node = null; // oldPort = null; //} oldPort = value; //if (oldPort != null) oldPort.Node = inputNode as Node; }
public bool IsConnectedTo(InputPort input) { return(IsConnected && input != null && Connection.End == input); }
public static bool CanBeConnected(InputPort input, OutputPort output) { return(!output.IsConnected && input.Node != output.Node); }