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()); } }
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()); } }