コード例 #1
0
        private void Start()
        {
            fsm = new HeroStateMachine();

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

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