コード例 #1
0
 public void                         PlayRandomIfNotPlaying(AudioClipListVar audioClipListVar)
 {
     if (this.CanPlay())
     {
         this.PlayRandom(audioClipListVar);
     }
 }
コード例 #2
0
 public void                         PlayRandom(AudioClipListVar audioClipListVar)
 {
     if (this.gameObject.activeInHierarchy)
     {
         var randClip = audioClipListVar.AudioClipList.RandClip;
         this._audioSource.clip = randClip;
         this._audioSource.Play();
         this._onClipBeganEvent.Invoke();
         if (this._fireOnClipEndsEvent)
         {
             CancelInvoke("FireClipEndsEvent");
             Invoke("FireClipEndsEvent", randClip.length);
         }
     }
 }