Exemple #1
0
 public AudioClip GetAudioPairs(AudibleNames.Target name)
 {
     if (this.audioPairs == null)
     {
         this.GenerateAudioPairs();
     }
     if (this.audioPairs.ContainsKey(name))
     {
         return(this.audioPairs [name]);
     }
     else
     {
         return(null);
     }
 }
 public void Play(AudibleNames.Target name, bool isLoop = false)
 {
     if (targetSFX == null)
     {
         if (GetComponentInChildren <TargetSFX>() != null)
         {
             this.targetSFX = GetComponentInChildren <TargetSFX>();
             if (this.targetSFX.GetAudioSource(name) != null)
             {
                 this.targetSFX.GetAudioSource(name).loop = isLoop;
                 this.PlaySource(targetSFX.GetAudioSource(name));
             }
         }
     }
     else
     {
         if (this.targetSFX.GetAudioSource(name) != null)
         {
             this.targetSFX.GetAudioSource(name).loop = isLoop;
             this.PlaySource(targetSFX.GetAudioSource(name));
         }
     }
 }
Exemple #3
0
 public AudioSource GetAudioSource(AudibleNames.Target name)
 {
     this.GetAudioSource().clip = this.GetAudioPairs(name);
     return(this.audioSource);
 }