/// <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)); } }
public AudioSource GetAudioSource(AudibleNames.Hammer name) { this.audioSource.clip = this.audioPairs [name]; Debug.Log(this.audioPairs [name].name); return(this.audioSource); }
public void SetSoundID(AudibleNames.Hammer id) { this.soundID = id; Debug.Log("<color=red>ID SET " + id.ToString() + "</color>"); }