示例#1
0
 /// <summary>
 /// Override Play function for needle SFX.
 /// </summary>
 /// <param name="name">SFX name</param>
 /// <param name="isLoop">If the sound will loop.</param>
 public void Play(AudibleNames.Needle name, bool isLoop)
 {
     if (needleSFX == null)
     {
         if (GetComponentInChildren <NeedleSFX> () != null)
         {
             this.needleSFX = GetComponentInChildren <NeedleSFX> ();
             this.needleSFX.GetAudioSource(name).loop = isLoop;
             this.PlaySource(needleSFX.GetAudioSource(name));
         }
     }
     else
     {
         this.needleSFX.GetAudioSource(name).loop = isLoop;
         this.PlaySource(needleSFX.GetAudioSource(name));
     }
 }
示例#2
0
 public AudioSource GetAudioSource(AudibleNames.Needle name)
 {
     this.audioSource.clip = this.audioPairs [name];
     return(this.audioSource);
 }