示例#1
0
 public AudioClip GetAudioPairs(AudibleNames.Door name)
 {
     if (this.audioPairs == null)
     {
         this.GenerateAudioPairs();
     }
     if (this.audioPairs.ContainsKey(name))
     {
         return(this.audioPairs [name]);
     }
     else
     {
         return(null);
     }
 }
示例#2
0
 /// <summary>
 /// Override Play function for door SFX.
 /// </summary>
 /// <param name="name">SFX name</param>
 /// <param name="isLoop">If the sound will loop.</param>
 public void Play(AudibleNames.Door name, bool isLoop)
 {
     if (doorSFX == null)
     {
         if (GetComponentInChildren <DoorSFX> () != null)
         {
             this.doorSFX = GetComponentInChildren <DoorSFX> ();
             if (this.doorSFX.GetAudioSource(name) != null)
             {
                 this.doorSFX.GetAudioSource(name).loop = isLoop;
                 this.PlaySource(doorSFX.GetAudioSource(name));
             }
         }
     }
     else
     {
         if (this.doorSFX.GetAudioSource(name) != null)
         {
             this.doorSFX.GetAudioSource(name).loop = isLoop;
             this.PlaySource(doorSFX.GetAudioSource(name));
         }
     }
 }
示例#3
0
 public AudioSource GetAudioSource(AudibleNames.Door name)
 {
     this.GetAudioSource().clip = this.GetAudioPairs(name);
     return(this.audioSource);
 }