public void ApplyConnection(NodeOutput output) { if (output == null) { return; } if (connection != null) { NodeEditorCallbacks.IssueOnRemoveConnection(this); connection.connections.Remove(this); } connection = output; output.connections.Add(this); if (!output.body.calculated) { NodeEditor.RecalculateFrom(output.body); } else { NodeEditor.RecalculateFrom(body); } output.body.OnAddOutputConnection(output); body.OnAddInputConnection(this); NodeEditorCallbacks.IssueOnAddConnection(this); }
public void RemoveConnection() { if (connection == null) { return; } NodeEditorCallbacks.IssueOnRemoveConnection(this); connection.connections.Remove(this); connection = null; NodeEditor.RecalculateFrom(body); }