Esempio n. 1
0
    public void MuteSoundSwitch()
    {
        if (isMute)
        {
            isMute = false; //bukak sound
            SoundButtonIcon.GetComponent <CustomSpriteSwapper>().changeAlphaColour(!isMute);
            FindObjectOfType <GameManager>().isSound = !isMute;
        }
        else
        {
            isMute = true; //tutup sound
            SoundButtonIcon.GetComponent <CustomSpriteSwapper>().changeAlphaColour(!isMute);
            FindObjectOfType <GameManager>().isSound = !isMute;
        }

        Debug.Log("Sound is " + !isMute);
        PlayerPrefs.SetInt(SOUND_SETTING, boolConverter.boolToInt(isMute));
    }