コード例 #1
0
        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);
        }
コード例 #2
0
        public void RemoveConnection()
        {
            if (connection == null)
            {
                return;
            }

            NodeEditorCallbacks.IssueOnRemoveConnection(this);
            connection.connections.Remove(this);
            connection = null;

            NodeEditor.RecalculateFrom(body);
        }