コード例 #1
0
 public void Tick()
 {
     if (currentState != nextState)
     {
         currentState.OnStateExit(this);
         currentState = nextState;
         currentState.OnStateEnter(this);
     }
     else
     {
         currentState.OnStateUpdate(this);
     }
 }
コード例 #2
0
 public StateController(AiState startingState, Enemy owner)
 {
     Owner        = owner;
     currentState = nextState = startingState;
 }