Example #1
0
        public NodeInputPort CreateInputPort(float weight = 1f)
        {
            NodeInputPort port = new NodeInputPort {
                Node = this, Index = InputPorts.Count, Weight = weight
            };

            Playable.SetInputCount(Playable.GetInputCount() + 1);
            Playable.SetInputWeight(port.Index, weight);

            InputPorts.Add(port);

            return(port);
        }
Example #2
0
        public override NodeLink Connect(NodeInputPort inputPort, NodeOutputPort outputPort)
        {
            if (outputPort.Node.CanSetTime)
            {
                outputPort.Node.Playable.SetTime(0f);
            }

            if (States.At(inputPort.Index) == CurrentState)
            {
                outputPort.Node.Playable.Play();
            }
            else if (States.At(inputPort.Index) == NextState)
            {
                outputPort.Node.Playable.Play();
            }
            //else if (outputPort.Node.Playable.GetOutputCount() < 2)
            //{
            //    outputPort.Node.Playable.Pause();
            //}

            inputPort.Weight = inputPort.Weight;

            return(base.Connect(inputPort, outputPort));
        }