Author Topic: UIButtonSound script missing  (Read 2822 times)

farazi482

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
UIButtonSound script missing
« on: August 16, 2014, 10:22:11 AM »
I m using ngui 3.5.6, it doesn't have UIButtonSound script in it. I have thoroughly searched. all I find is UIPlaySound script, which is also not playing my sound onClick trigger.
I want to play a sound when button is clicked.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIButtonSound script missing
« Reply #1 on: August 16, 2014, 11:08:26 AM »
First, you need to update. Current latest is 14 updates ahead of yours.

Second, UIPlaySound in NGUI 3 is what UIButtonSound was in NGUI 2. It's used to play sounds on click the same way you set it up. Update to the latest and drag in a Colored Button prefab into the scene from the Prefab Toolbar. It has UIPlaysound on it, which works.

If you can't hear a sound, check your main camera and the listener attached to it.

farazi482

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: UIButtonSound script missing
« Reply #2 on: August 16, 2014, 12:58:40 PM »
Thanks. It was not working but then I restarted Unity and it worked. don't know what was wrong with it before.  :)