예제 #1
0
 public void ChangeState()
 {
     //go to currentState exit, then newState Enter, then set the new state
     currentState.Exit(next);
     //note - makes sure currentState exits pre newState starting
     newState.Enter();
     currentState = newState;
 }
예제 #2
0
 public void ChangeState(int next)
 {
     //finish old state
     currentState.Exit(next);
     //set current state as the new state, then start the new state
     currentState = syStates[next];
     debugText    = statesTxt[next];
     currentState.Enter();
 }