예제 #1
0
        public override void Process()
        {
            if (active)
            {
                bool up   = KeyMapper.GetAxis("Vertical") > 0;
                bool down = KeyMapper.GetAxis("Vertical") < 0;

                bool select = KeyMapper.GetButtonDown("Jump") || Input.GetKeyDown(KeyCode.Return);

                if (canMove >= 20)
                {
                    if (up)
                    {
                        selectedButton = (selectedButton + buttons.Length - 1) % buttons.Length;
                        canMove        = 0;
                    }
                    if (down)
                    {
                        selectedButton = (selectedButton + buttons.Length + 1) % buttons.Length;
                        canMove        = 0;
                    }
                }
                else
                {
                    canMove++;
                }

                eventSystem.SetSelectedGameObject(buttons[selectedButton]);

                if (select)
                {
                    buttons[selectedButton].GetComponent <Button>().onClick.Invoke();
                }
            }
        }
예제 #2
0
 private void OnTriggerStay2D(Collider2D other)
 {
     if (other.CompareTag("Player") && !paused && accessible)
     {
         if (KeyMapper.GetButtonDown("Start"))
         {
             GameManagerScript.gameManager.Enter(targetLevel, mansionOfMadness);
         }
     }
 }
예제 #3
0
 private void OnTriggerStay2D(Collider2D other)
 {
     if (other.CompareTag("Player") && !paused && teleporter.accessible)
     {
         if (KeyMapper.GetButtonDown("Start"))
         {
             Enter();
         }
     }
 }
 /// <summary>
 ///! this is only for one time controls IE buttonUP buttonDOWN
 /// </summary>
 void FetchOneTimeControls()
 {
     if (KeyMapper.GetButtonDown("Jump"))
     {
         jumpButtonDown = true;
     }
     if (KeyMapper.GetButtonUp("Jump"))
     {
         jumpButtonUp = true;
     }
 }
예제 #5
0
 private void Update()
 {
     if (KeyMapper.GetButtonDown("Pause") && currentHandle.buildIndex != 0)
     {
         ToggleGamePaused();
         if (paused)
         {
             PauseMenu.menu.Show();
         }
         else
         {
             PauseMenu.menu.Hide();
         }
     }
 }