Author Topic: Problem with NGUI adding AudioListener  (Read 921 times)

Bradamante3D

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 79
    • View Profile
Problem with NGUI adding AudioListener
« on: September 17, 2015, 01:04:40 PM »
Hi,

here's my situation. In my game, I am loading content from a different level additively. That's the "Content" level. The Content level includes a MasterAudio prefab + an Audio Listener + some helper cameras, but no NGUI elements (it will soon).

This Content level is being loaded from the "Campaign" level which includes a specific NGUI setup. The Campaign level included a NGUI Tooltip GameObject with the standard NGUI Tooltip script. That GameObject also includes a NGUI Play Sound script that plays a sound OnDisable.

The problem is that the tooltip triggers this sound before the Content level is fully loaded. Since the Campaign scene includes no AudioListeners, NGUI creates one. Since the MainCamera is in the Content scene, NGUI puts it on one of the friggin helper cameras. Now my scene included two AudioListeners and Unity comes to a halt.

If I deactivate the NGUI Tooltip object in the scene view of the Campaign level, this does not happen and everything works. But then the Tooltip doesn't draw anymore, since NGUI (for whatever reason) requires the GameObject to be (x) active in the beginning.

Anybody got any ideas?

Would it help not to use NGUIs PlaySound script, but to channel everything through MasterAudio?
#301224014, #301432336, #302399130

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,154
  • Toronto, Canada
    • View Profile
Re: Problem with NGUI adding AudioListener
« Reply #1 on: September 20, 2015, 02:44:27 AM »
It sounds to me like you need to cover your screen with a widget that will intercept all events, or just turn off mouse events on the UICamera while your scene is loading.