Example #1
0
        public override void Execute(FSMBehaviour fsm)
        {
            //NullReference Bugfix
            if (goToState == null)  //Nao permite estados nullos
            {
                return;
            }

            //StackOverflow Bufix
            if (goToState == this)  //Não permite eu mesmo como estado
            {
                return;
            }


            //StackOverflow Bufix
            if (goToState == connectedState) //Não permite que o proximo estado seja o estado em que eu estou conectado.
            {
                return;
            }


            //Jump to node
            goToState.SetCurrentState();
        }
Example #2
0
        public override void Execute(FSMBehaviour fsm)
        {
            NodePort outPort = GetOutputPort("outState");

            if (outPort.ConnectionCount > 0)
            {
                NodeBase_State next = (NodeBase_State)outPort.Connection.node;
                next.SetCurrentState();
            }
        }
Example #3
0
        private void GoToNextState(bool decisionResult)
        {
            if (decisionResult == false)
            {
                return;
            }

            NodeBase_State nextState = GetNextState();

            if (nextState == null)
            {
                return;
            }

            nextState.SetCurrentState();
        }
Example #4
0
            public void ExecuteDecisions(FSMBehaviour fsm)
            {
                if (outputPort.ConnectionCount <= 0)
                {
                    return;
                }

                bool result = GetDecisionResult(fsm);

                //Transition to other state
                if (result == false && outputPort.ConnectionCount <= 0)
                {
                    return;
                }

                NodeBase_State state = (NodeBase_State)outputPort.Connection.node;

                state.SetCurrentState();
            }
Example #5
0
 private void GoToNextState(bool decisionResult)
 {
     if (decisionResult)
     {
         NodeBase_State nextTrueState = GetNextTrueState();
         if (nextTrueState)
         {
             nextTrueState.SetCurrentState();
         }
     }
     else
     {
         NodeBase_State nextFalseState = GetNextFalseState();
         if (nextFalseState)
         {
             nextFalseState.SetCurrentState();
         }
     }
 }