Esempio n. 1
0
 void ChangeToState(string nextState)
 {
     ZeroCounter();
     activeState = loader.GetState(nextState);
     if (activeState.GetAction() == Action.RUN_SUB_FSM)            //If this state is parent to a sub fsm
     {
         SpawnFSMStartingWithState(activeState.GetStartingSubstate());
     }
 }
Esempio n. 2
0
    public void InitialiseFSM(string startingState, FSMLoader load, AIMotorActions aiM, AIConditionChecker aiC, Transform parentT)
    {
        loader      = load;
        activeState = loader.GetState(startingState);

        motorActions     = aiM;
        conditionChecker = aiC;
        parentTransform  = parentT;

        fsmCounter        = new FSMCounter();
        fsmCounter.timer  = 0f;
        fsmCounter.frames = 0;

        if (activeState.GetAction() == Action.RUN_SUB_FSM)
        {
            SpawnFSMStartingWithState(activeState.GetStartingSubstate());
        }
    }