コード例 #1
0
ファイル: MenuController.cs プロジェクト: chritaq/FlameJump
 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
ファイル: MenuController.cs プロジェクト: chritaq/FlameJump
 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
ファイル: MenuController.cs プロジェクト: chritaq/FlameJump
    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;
            }
        }
    }