Exemplo n.º 1
0
    void Update()
    {
        Button = EventSystem.current.currentSelectedGameObject;
        //Debug.Log(Button);

        for (int i = 0; i < ButtonEffect.Length; i++)
        {
            if ((Button == ButtonEffect[i]) && (Button != ButtonBuf))
            {
                /*On change de bouton*/
                SoundManagerMain.PlaySound(SoundManagerMain.Sound.select);

                ButtonEffect[i].GetComponent <TextEffect1>().enabled = true;

                TextEffect1 buf = ButtonBuf.GetComponent <TextEffect1>();
                buf.ResetColor();
                buf.enabled = false;

                ButtonBuf = Button;
            }
        }
    }
Exemplo n.º 2
0
    void Update()
    {
        Button = EventSystem.current.currentSelectedGameObject;


        for (int i = 0; i < ButtonEffect.Length; i++)
        {
            if ((Button == ButtonEffect[i]) && (Button != ButtonBuf))
            {
                /*On change de bouton*/
                SoundManagerMain.PlaySound(SoundManagerMain.Sound.select);


                ButtonEffect[i].GetComponent <TextEffect1>().enabled = true;

                TextEffect1 buf = ButtonBuf.GetComponent <TextEffect1>();
                buf.ResetColor();
                buf.enabled = false;

                ButtonBuf = Button;
            }
        }

        if (rank.getfRank())
        {
            ButtonEffect[3].GetComponent <Button>().Select();
            rankTmp = rank.getfRank();
        }
        else
        {
            if (rankTmp != rank.getfRank())
            {
                ButtonEffect[2].GetComponent <Button>().Select();
                rankTmp = rank.getfRank();
            }
        }
    }