Author Topic: UIPlaySound Request for OnDoubleClick  (Read 1971 times)

Yukichu

  • Full Member
  • ***
  • Thank You
  • -Given: 3
  • -Receive: 8
  • Posts: 101
    • View Profile
UIPlaySound Request for OnDoubleClick
« on: September 26, 2013, 04:38:05 PM »
Could we get UIPlaySound to have OnDoubleClick as part of the default options?

Possibly even all of the default events... never know, might be useful.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIPlaySound Request for OnDoubleClick
« Reply #1 on: September 26, 2013, 04:40:36 PM »
  1. using UnityEngine;
  2.  
  3. public class DoubleClickSound : MonoBehaviour
  4. {
  5.     public AudioClip clip;
  6.  
  7.     void OnDoubleClick () { NGUITools.PlaySound(clip, 1f, 1f); }
  8. }

Yukichu

  • Full Member
  • ***
  • Thank You
  • -Given: 3
  • -Receive: 8
  • Posts: 101
    • View Profile
Re: UIPlaySound Request for OnDoubleClick
« Reply #2 on: September 26, 2013, 06:31:07 PM »
I know I can create a script easily enough, but for simplicity sake, having it in the dropdown of the default UIPlaySound script that is added with the Button widgets would be great.  That was my request.

Thanks!