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