public AudioClip GetAudioPairs(AudibleNames.Crosshair name) { if (this.audioPairs == null) { this.GenerateAudioPairs(); } if (this.audioPairs.ContainsKey(name)) { return(this.audioPairs [name]); } else { return(null); } }
public void Play(AudibleNames.Crosshair name, bool isLoop = false) { if (crosshairSFX == null) { if (GetComponentInChildren <CrosshairSFX> () != null) { this.crosshairSFX = GetComponentInChildren <CrosshairSFX> (); if (this.crosshairSFX.GetAudioSource(name) != null) { this.crosshairSFX.GetAudioSource(name).loop = isLoop; this.PlaySource(crosshairSFX.GetAudioSource(name)); } } } else { if (this.crosshairSFX.GetAudioSource(name) != null) { this.crosshairSFX.GetAudioSource(name).loop = isLoop; this.PlaySource(crosshairSFX.GetAudioSource(name)); } } }
public AudioSource GetAudioSource(AudibleNames.Crosshair name) { this.GetAudioSource().clip = this.GetAudioPairs(name); return(this.audioSource); }