Ejemplo n.º 1
0
        private void cacheOldConnections()
        {
            // Check if the receiving node was already connected.
            if (_input != null && _input.HasOutputConnected())
            {
                _oldConnectedOutput = _input.OutputConnection;
            }

            // Check if the origin node already had inputs
            if (!_output.bCanHaveMultipleConnections && _output.InputCount > 0)
            {
                _oldConnectedInputs = _output.Inputs.ToList();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Should only be called by NodeOutput.
        /// </summary>
        internal void Disconnect()
        {
            if (_connectedOutput.Inputs.Contains(this))
            {
                const string msg =
                    "Cannot disconnect. " +
                    "The Output should remove this Input from its input list first, " +
                    "before calling Disconnect().";

                Debug.LogWarning(msg);
            }

            else
            {
                _connectedOutput = null;
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Should only be called by NodeOutput
        /// </summary>
        /// <param name="output"></param>
        internal void Connect(NodeOutput output)
        {
            if (!HasOutputConnected())
            {
                _connectedOutput = output;
            }

            else
            {
                const string msg =
                    "Connot Connect." +
                    "The Input has an output connected and should be disconnected first, " +
                    "before trying to connect to some output.";

                Debug.LogWarning(msg);
            }
        }
Ejemplo n.º 4
0
        private void reconnectOldConnections()
        {
            // For all the remembered inputs (of this node) to output pairs, reconnect.
            foreach (InputToOutputPair inOutPair in _oldConnectedOutputs)
            {
                NodeInput  input  = inOutPair.item1;
                NodeOutput output = inOutPair.item2;

                output.Add(input);
            }

            // For all the remembered outputs (of this node) to inputs, reconnect.
            foreach (OutputToInputsPair outInsPair in _oldConnectedInputs)
            {
                NodeOutput       output = outInsPair.item1;
                List <NodeInput> inputs = outInsPair.item2;

                foreach (var input in inputs)
                {
                    output.Add(input);
                }
            }
        }
Ejemplo n.º 5
0
 public override void OnActionStart()
 {
     _output = manager.window.state.selectedOutput;
 }
 private void onOutputKnobSelected(NodeOutput output)
 {
     _manager.window.state.selectedOutput = output;
 }