示例#1
0
    public void MusicOn()
    {
        m_LobbyController.PlayerButtonEffect();

        if (Common.ConfigMusicOn)
        {
            Common.SetMusicConfig(false);
        }
        else
        {
            Common.SetMusicConfig(true);
        }

        if (Common.ConfigMusicOn)
        {
            transform.Find("Consoles/Music/Button").GetComponent <Image>().sprite = Resources.Load("Image/Lobby/select_on", typeof(Sprite)) as Sprite;
            transform.Find("Consoles/Music/Button/Image").DOLocalMoveX(19, 0.2f);
            m_LobbyController.PlayMusic();
        }
        else
        {
            transform.Find("Consoles/Music/Button").GetComponent <Image>().sprite = Resources.Load("Image/Lobby/select_off", typeof(Sprite)) as Sprite;
            transform.Find("Consoles/Music/Button/Image").DOLocalMoveX(-19, 0.2f);
            m_LobbyController.StopMusic();
        }
    }