Example #1
0
 public AudioClip GetAudioPairs(AudibleNames.Button name)
 {
     if (this.audioPairs == null)
     {
         this.GenerateAudioPairs();
     }
     if (this.audioPairs.ContainsKey(name))
     {
         return(this.audioPairs [name]);
     }
     else
     {
         return(null);
     }
 }
Example #2
0
 /// <summary>
 /// Override Play function for button click SFX.
 /// </summary>
 /// <param name="name">SFX name</param>
 /// <param name="isLoop">If the sound will loop.</param>
 public void Play(AudibleNames.Button name, bool isLoop)
 {
     if (buttonSFX == null)
     {
         if (GetComponentInChildren <ButtonSFX> () != null)
         {
             this.buttonSFX = GetComponentInChildren <ButtonSFX> ();
             this.buttonSFX.GetAudioSource(name).loop = isLoop;
             this.PlayOneShot(buttonSFX.GetAudioSource(name));
         }
     }
     else
     {
         this.buttonSFX.GetAudioSource(name).loop = isLoop;
         this.PlayOneShot(buttonSFX.GetAudioSource(name));
     }
 }
Example #3
0
 public AudioSource GetAudioSource(AudibleNames.Button name)
 {
     this.GetAudioSource().clip = this.GetAudioPairs(name);
     return(this.audioSource);
 }