private void SwitchToNewState(Type nextState)
 {
     currState.Exit();
     currState = availableStates[nextState];
     currState.Enter();
     OnStateChanged?.Invoke(currState); //??
 }
Exemplo n.º 2
0
    protected virtual void Start()
    {
        _audioSource = GetComponent <AudioSource>();

        fallState = new EnemyFallState(this);
        currentState.Enter();
    }
Exemplo n.º 3
0
 public void ChangeState(EnemyBaseState newState)
 {
     currentState.Exit();
     currentState = newState;
     newState.Enter();
 }