public void Tick() { if (currentState != nextState) { currentState.OnStateExit(this); currentState = nextState; currentState.OnStateEnter(this); } else { currentState.OnStateUpdate(this); } }
public StateController(AiState startingState, Enemy owner) { Owner = owner; currentState = nextState = startingState; }