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