Esempio n. 1
0
 /// <summary>
 /// Returns the popcorn enemy SFX.
 /// </summary>
 /// <returns>Popcorn Enemy SFX</returns>
 public PopcornSFX GetPopcornSFX()
 {
     if (this.popcornSFX == null)
     {
         if (GetComponentInChildren <PopcornSFX> () != null)
         {
             this.popcornSFX = GetComponentInChildren <PopcornSFX> ();
         }
     }
     return(this.popcornSFX);
 }
Esempio n. 2
0
 /// <summary>
 /// Override Play function for popcorn enemy SFX.
 /// </summary>
 /// <param name="name">SFX name</param>
 /// <param name="isLoop">If the sound will loop.</param>
 public void Play(AudibleNames.Popcorn name, bool isLoop)
 {
     if (popcornSFX == null)
     {
         if (GetComponentInChildren <PopcornSFX> () != null)
         {
             this.popcornSFX = GetComponentInChildren <PopcornSFX> ();
             this.popcornSFX.GetAudioSource(name).loop = isLoop;
             this.PlaySource(popcornSFX.GetAudioSource(name));
         }
     }
     else
     {
         this.popcornSFX.GetAudioSource(name).loop = isLoop;
         this.PlaySource(popcornSFX.GetAudioSource(name));
     }
 }