Пример #1
0
 /// <summary>
 /// Override Play function for hammer SFX.
 /// </summary>
 /// <param name="name">SFX name</param>
 /// <param name="isLoop">If the sound will loop.</param>
 public void Play(AudibleNames.Hammer name, bool isLoop)
 {
     if (hammerSFX == null)
     {
         if (GetComponentInChildren <HammerSFX> () != null)
         {
             this.hammerSFX = GetComponentInChildren <HammerSFX> ();
             this.hammerSFX.GetAudioSource(name).loop = isLoop;
             this.PlayOneShot(hammerSFX.GetAudioSource(name));
         }
     }
     else
     {
         this.hammerSFX.GetAudioSource(name).loop = isLoop;
         this.PlayOneShot(hammerSFX.GetAudioSource(name));
     }
 }
Пример #2
0
 public AudioSource GetAudioSource(AudibleNames.Hammer name)
 {
     this.audioSource.clip = this.audioPairs [name];
     Debug.Log(this.audioPairs [name].name);
     return(this.audioSource);
 }
Пример #3
0
 public void SetSoundID(AudibleNames.Hammer id)
 {
     this.soundID = id;
     Debug.Log("<color=red>ID SET " + id.ToString() + "</color>");
 }