Example #1
0
    public void ToggleSound()
    {
        bool isOn = PlayerPrefsPersister.GetAudioStatus();

        if (!isOn)
        {
            isOn = true;
            PlayerPrefsPersister.SetAudioStatus(isOn.ToString());
        }
        else
        {
            isOn = false;
            PlayerPrefsPersister.SetAudioStatus(isOn.ToString());
        }
        UpdateAudioStatus(isOn);
    }
Example #2
0
 // Use this for initialization
 void Start()
 {
     UpdateAudioStatus(PlayerPrefsPersister.GetAudioStatus());
 }