/*-------------------------------------------------------------------------*/ public void Start() { if (stateList.Count == 0) { Debug.Log("There is no state in this FSM."); return; } currentState.OnStateEnter(); }
/*-------------------------------------------------------------------------*/ internal void SetState(StateID stateID) { foreach (FSMState state in stateList) { if (state.ID == stateID) { currentState.OnStateExit(); lastState = currentState; currentState = state; currentState.OnStateEnter(); return; } } Debug.Log("Invalid state or state does not belong to this FSM."); }