Hi,
My game has a mute button which saves when you quit. The problem is, when you press “Home Button” and return back to the game, music plays even though Mute button is ON.
I’ve tried : OnApplicationPause, OnApplicationFocus, etc but it doesn’t seem to work.
Do you know any workaround to fix this ?
Thanks in advance !
int IsMuted;
void OnApplicationPause(bool Pause)
{
if(Pause)
SoundCheck ();
}
void SoundCheck()
{
IsMuted = PlayerPrefs.GetInt("Sound");
if(IsMuted == 1)
{
AudioListener.pause = false;
}
else
{
AudioListener.pause = true;
}
}