Exemplo n.º 1
0
    public void GoBack()
    {
        if (aboveState != null)
        {
            ServiceLocator.GetAudio().PlaySound("Pickup_Recharge", SoundType.normal);
            ServiceLocator.GetGamepadRumble().StartGamepadRumble(GamepadRumbleProvider.RumbleSize.small);
            currentState.Exit(this);
            currentState = aboveState;
            currentState.Enter(this);

            if (selectedInMenu2 != null)
            {
                eventSystem.SetSelectedGameObject(selectedInMenu2);
                selectedInMenu2 = null;
            }
            else
            {
                eventSystem.SetSelectedGameObject(selectedInMenu1);
                selectedInMenu1 = null;
            }
        }
    }