public void Mute() { float volume; mixer.GetFloat("Master", out volume); if (volume == -80) { mixer.SetFloat("Master", 0); DataSystem.SaveSoundState(true); } else { mixer.SetFloat("Master", -80); DataSystem.SaveSoundState(false); } }
void Start() { if (Instance == null) { Instance = this; audioSourceComp = GetComponent <AudioSource>(); } else { Destroy(this); } if (PlayerPrefs.GetInt(KeySotrage.FIRSTOPEN_I) == 0) { PlayerPrefs.SetInt(KeySotrage.FIRSTOPEN_I, 1); DataSystem.SaveSoundState(true); } Mute(DataSystem.LoadSoundState()); }