Ejemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (!Opt.IsActive())
        {
            if (selection != LastSelection)
            {
                //run coroutine

                LastSelection       = selection;
                destinationRotation = MenuAngles[selection];
                StartCoroutine(RotateHand());
            }

            for (int i = 0; i < menuOptions.Length; i++)
            {
                if (i != selection)
                {
                    menuOptions[i].rectTransform.localPosition = new Vector2(menuStartX[i], menuOptions[i].rectTransform.localPosition.y);
                    menuOptions[i].color = Color.white;
                }
                else
                {
                    menuOptions[i].rectTransform.localPosition = new Vector2(menuStartX[i] + offset, menuOptions[i].rectTransform.localPosition.y);
                    menuOptions[i].color = Color.yellow;
                }
            }


            if (Input.GetKeyDown(KeyCode.DownArrow))
            {
                selection++;
            }
            else if (Input.GetKeyDown(KeyCode.UpArrow))
            {
                selection--;
            }
            else if (Input.GetButtonDown("Jump") && selection == 2)
            {
                Options();
            }

            if (Input.GetButtonDown("Cancel") && Opt.IsActive())
            {
                Opt.SetInactive();
            }
            selection = (selection < 0) ? menuOptions.Length - 1 : (selection >= menuOptions.Length) ? 0 : selection;
        }
    }
Ejemplo n.º 2
0
    // Update is called once per frame

    void Update()
    {
        if (Input.GetButtonDown("Cancel"))
        {
            if (Opt.IsActive())
            {
                Opt.SetInactive();
            }
            else if (!IsActive())
            {
                if (pop.showPopup)
                {
                }
                else
                {
                    SetActive();
                }
            }
            else
            {
                SetInactive();
            }
        }
    }