Example #1
0
    void ProcessMenuInput()
    {
        float horizontal = Input.GetAxis("Horizontal");
        float vertical   = Input.GetAxis("Vertical");

        if (horizontal > 0)
        {
            customMenu.MoveSelected(MenuDirection.Right);
        }
        else if (horizontal < 0)
        {
            customMenu.MoveSelected(MenuDirection.Left);
        }
        else if (vertical > 0)
        {
            customMenu.MoveSelected(MenuDirection.Up);
        }
        else if (vertical < 0)
        {
            customMenu.MoveSelected(MenuDirection.Down);
        }
        else if (Input.GetButtonDown("Select"))
        {
            customMenu.SelectSlot();
        }
        else if (Input.GetButtonDown("Cancel"))
        {
            customMenu.UndoSelectSlot();
        }
        if (Input.GetButtonDown("Custom Menu"))
        {
            CloseCustomMenu();
        }
    }