Exemplo n.º 1
0
 public static void PlaySound(AudioClip clip)
 {
     if (!SFXSource.isPlaying)
     {
         SFXSource.PlayOneShot(clip);
     }
 }
Exemplo n.º 2
0
        public static void PlayOneShot(AudioBundle bundle, string audioName, Action onAudioEnd, float volumeScale = 1.0f)
        {
            AudioClip clip = GetClip(bundle, audioName);

            SFXSource.PlayOneShot(clip, volumeScale);
            Framework.Extensions.DelayAction(clip.length, onAudioEnd);
        }
Exemplo n.º 3
0
        public static void PlayOneShot(MonoBehaviour mono, TPAudioBundle bundle, string audioName, Action onAudioEnd, float volumeScale = 1.0f)
        {
            AudioClip clip = GetClip(bundle, audioName);

            SFXSource.PlayOneShot(clip, volumeScale);
            mono.StartCoroutine(DelayAction(clip.length, onAudioEnd));
        }
Exemplo n.º 4
0
 public static void PlayOneShot(AudioBundle bundle, string audioName, float volumeScale = 1.0f)
 {
     SFXSource.PlayOneShot(GetClip(bundle, audioName), volumeScale);
 }