Exemplo n.º 1
0
    private void SwitchState(IPlayerState newState)
    {
        if (!playerStates.Contains(newState) && playerStates[0] == defaultState)
        {
            if (newState.IsBlockingState())
            {
                stateVariables.velBody.velocity = Vector3.zero;

                //Force reset dash state to prevent invincibility
                dashState.ResetState();

                playerStates.Clear();
            }
            playerStates.Add(newState);
            stateVariables.stateFinished = false;
            stateChanged = true;
        }
    }