Author Topic: Listener in NGUITools  (Read 4331 times)

Alessaint

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 67
    • View Profile
Listener in NGUITools
« on: October 14, 2012, 06:34:05 AM »
Hi,

I haven't checked for a new version in a while so it might have been already fixed but anyway - there is a problem in NGUITools where audioListener is stored in static mListener the first time PlaySound is called, however this doesn't take in account that the GO with listener may become deactivated later on - PlaySound then fails because it tries to play a sound on disabled audioSource. What did is just change line 38 to
if (mListener == null || !mListener.gameObject.activeInHierarchy)
which forces it look for another appropriate listener.

Regards,

Ales

kreso

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: Listener in NGUITools
« Reply #1 on: November 27, 2013, 03:48:13 PM »
This is still the case. Grateful I found your code.


Thanks,
Kreso
« Last Edit: November 27, 2013, 03:54:41 PM by kreso »