private void Start() { fsm = new HeroStateMachine(); idleState = new IdleState(this, fsm); runningState = new RunningState(this, fsm); fsm.Start(idleState); }
public void ChangeState(HeroState newState) { currentState.OnExit(); currentState = newState; currentState.OnEnter(); }
public void Start(HeroState initialState) { currentState = initialState; currentState.OnEnter(); }