Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: primus88 on December 29, 2013, 07:17:12 AM
-
Hi guys,
I have a listener on the main camera in my game.
Also, I made sure to deactivate the listener on NGUI camera.
The problem is that there are no GUI sounds playing.
I have about the same setup in another scene and works. The difference is that, in the first scene the camera is not from the beginning in the scene but it is spawned after about 1 second.
Could that be the reason? Is NGUI like checking for the audio listener in the beginning, he doesn't find it (because it is not yet spawned) and does not reproduce anymore GUI sounds?
If this is indeed the problem, how can I get around it? Because I must have the listener spawn after 1s.. can't do it sooner due to different constraints.
Thanks
-
Have a look inside NGUITools.PlaySound. It does cache the listener, but it finds a new one if the existing listener is disabled. It looks for the listener on the main camera. If no main camera is present, it looks for any camera. Once a camera is found, if it has no listener, NGUI adds one.