Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: AlexGav on August 05, 2013, 06:44:07 AM

Title: NGUITools plays the sound even when AudioListener.volume is set to 0
Post by: AlexGav on August 05, 2013, 06:44:07 AM
All the buttons in my project have the UIButtonSound script on them and after the update to Unity 4.2 the sound is played even though the AudioListener volume is set to 0.
There is only one AudioListener in the scene.
I can add an extra flag to the if condition checking that the audio listener is not null and enabled for the audio listener volume inside the PlaySound method, but I would rather not change an NGUI script.
Does anyone else have a better solution?
Title: Re: NGUITools plays the sound even when AudioListener.volume is set to 0
Post by: ArenMook on August 05, 2013, 08:02:10 AM
NGUITools.soundVolume controls it (also UISoundVolume script)
Title: Re: NGUITools plays the sound even when AudioListener.volume is set to 0
Post by: AlexGav on August 06, 2013, 03:11:24 AM
Thanks for the tip, but that doesn't really work because the in-game music and other sounds are not controlled through NGUI, it's just the buttons.
Having to also control the NGUITools.soundVolume everywhere besides the AudioListener.volume is not exactly what I am looking for.
Do you have any idea what might cause the sound to be played when it should be muted?
Title: Re: NGUITools plays the sound even when AudioListener.volume is set to 0
Post by: ArenMook on August 07, 2013, 05:54:23 AM
What doesn't work? NGUI always plays its own sounods through NGUITools.PlaySound, which is affected by NGUITools.soundVolume. When you're adjusting your audio listener volume, also set NGUITools.soundVolume as well, and everything will be as you expect.
Title: Re: NGUITools plays the sound even when AudioListener.volume is set to 0
Post by: Dusty E-D on January 06, 2014, 01:12:42 PM
Did this change in unity 4.3?  I have my project set up so that it sets the AudioListener volume to 0 but leaves the NGUITools.soundVolume setting at the settings slider value.  I'm pretty sure it was working but just noticed today that even though the volume values are all correct I don't hear any of the sounds getting played with NGUITools.PlaySound.  If I set the AudioListeners volume to 1 along with all my background sounds I do hear sounds getting played through NGUITools.PlaySound again.
Title: Re: NGUITools plays the sound even when AudioListener.volume is set to 0
Post by: ArenMook on January 06, 2014, 05:22:03 PM
I vaguely remember reading a similar thread ~1 month ago about this behaving differently in 4.3...