private void SwitchToNewState(Type nextState) { currState.Exit(); currState = availableStates[nextState]; currState.Enter(); OnStateChanged?.Invoke(currState); //?? }
protected virtual void Start() { _audioSource = GetComponent <AudioSource>(); fallState = new EnemyFallState(this); currentState.Enter(); }
public void ChangeState(EnemyBaseState newState) { currentState.Exit(); currentState = newState; newState.Enter(); }