/// <summary> /// Override Play function for player avatar SFX. /// </summary> /// <param name="name">SFX name</param> /// <param name="isLoop">If the sound will loop.</param> public void Play(AudibleNames.Yuni name, bool isLoop) { if (yuniSFX == null) { if (GetComponentInChildren <YuniSFX> () != null) { this.yuniSFX = GetComponentInChildren <YuniSFX> (); this.yuniSFX.GetAudioSource(name).loop = isLoop; this.PlayOneShot(yuniSFX.GetAudioSource(name)); } } else { this.yuniSFX.GetAudioSource(name).loop = isLoop; this.PlayOneShot(yuniSFX.GetAudioSource(name)); } }
public AudioSource GetAudioSource(AudibleNames.Yuni name) { this.audioSource.clip = this.audioPairs [name]; return(this.audioSource); }