I know here were several questions about mute-buttons and I could somehow use the answers here. However it’s not working in a way I expected it to. When i click my mute-button all active sounds turn silent (which is good!) but alltough the AudioListener is paused, newly instantiated audioSources are hearable. When I unmute and mute again they turn silent, too, but I want a mute-button that keeps everything quiet all the time.
Instead of pausing them, you could do `AudioListener.volume = 0.0F;` That would make all of the sounds at 0 volume, although I'm pretty sure that they would still play in the background, although the script reference (http://unity3d.com/support/documentation/ScriptReference/AudioListener-pause.html) for `AudioListener.pause` says that its the same as setting the volume to 0.
Try this script in replace of your current one, it's a bit of a modification:
This is the first time I have really ever programmed in C#!!!!!!!!!!!, at first it didn't work, but that was only because of the variable type, it had to be type 'bool', and I didn't specify the type. But after I realised it didn't work, I wrote it in JavaScript for you, so now you got both!!!
I agree they should change the manual for AudioListener.pause. It is not the same as setting AudioListener.volume = 0f for the exact reasons outlined above (NEW sounds don’t get set to zero). This is confusing and definitely wasted me some time.