Example #1
0
        private void Start()
        {
            fsm = new HeroStateMachine();

            idleState    = new IdleState(this, fsm);
            runningState = new RunningState(this, fsm);

            fsm.Start(idleState);
        }
Example #2
0
 public void ChangeState(HeroState newState)
 {
     currentState.OnExit();
     currentState = newState;
     currentState.OnEnter();
 }
Example #3
0
 public void Start(HeroState initialState)
 {
     currentState = initialState;
     currentState.OnEnter();
 }