OnHover() публичный Метод

public OnHover ( bool isOver ) : void
isOver bool
Результат void
Пример #1
0
    void DetectPosition(int number) // This makes the buttons on the main menu change color when the player hover over them
    {
        int one = 1, two = 2;

        if (number != previousPosition)
        {
            if (number == zero)
            {
                gallery.OnHover(false);
                play.OnHover(false);
                quit.OnHover(true);
            }
            else if (number == one)
            {
                quit.OnHover(false);
                play.OnHover(false);
                gallery.OnHover(true);
            }
            else if (number == two)
            {
                quit.OnHover(false);
                gallery.OnHover(false);
                play.OnHover(true);
            }

            //Plays hover SFX
            AudioController.Play("UI_ButtonHover");
        }
    }
Пример #2
0
    private void UpdateArrow()
    {
        if (arrowPos >= 3)
        {
            arrowPos = 0;
        }
        else if (arrowPos <= -1)
        {
            arrowPos = 2;
        }

        if (selectedButton != null)
        {
            selectedButton.GetComponent <UIButton>().OnExit();
        }
        if (arrowPos == 0)
        {
            startButton.OnHover();
            //creditsButton.OnExit();
            //exitButton.OnExit();
        }
        else if (arrowPos == 1)
        {
            //startButton.OnExit();
            creditsButton.OnHover();
            //exitButton.OnExit();
        }
        else if (arrowPos == 2)
        {
            //startButton.OnExit();
            //creditsButton.OnExit();
            exitButton.OnHover();
        }

        /*if(arrowPos == 0)
         *  resume.GetComponent<UIButton>().OnHover();
         * else
         *  mainMenu.GetComponent<UIButton>().OnHover();*/
    }