private void InitializeState() { switch (initialState) { case EnemyState.Attacking: currentState = attackingState; break; case EnemyState.Chasing: currentState = chasingState; break; case EnemyState.Patrolling: currentState = patrollingState; break; default: currentState = null; break; } currentState.OnStateEnter(); }