示例#1
0
 private void Start()
 {
     eventSystem  = EventSystem.current;
     currentState = new MenuMainState();
     currentState.Enter(this);
     StartCoroutine(PlayMusicDelay());
 }
示例#2
0
 public void ChangeState(string state)
 {
     if (states.ContainsKey(state))
     {
         currentState = states[state];
         currentState.Enter();
     }
 }
示例#3
0
 private void ChangeState(MenuState menuState)
 {
     ServiceLocator.GetAudio().PlaySound("Pickup_Recharge", SoundType.menuSound);
     ServiceLocator.GetGamepadRumble().StartGamepadRumble(GamepadRumbleProvider.RumbleSize.small);
     SetMenuAboveButton();
     currentState.Exit(this);
     currentState = menuState;
     currentState.Enter(this);
 }
示例#4
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;
            }
        }
    }