Exemplo n.º 1
0
        private void Start()
        {
            fsm = new HeroStateMachine();

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

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