public static void PlayClip(SFXClipName name) { if (__instance__ == null) { __instance__ = FindObjectOfType <SFXController>(); } if (SFXController.__instance__) { __instance__.PlaySFX(name); } }
public void PlaySFX(SFXClipName name) { if (clips == null) { return; } for (int i = 0; i < clips.Length; i++) { if (clips[i] != null && clips[i].name == name) { PlayClip(clips[i].clips); return; } } }
/// <summary> /// Plays a single shot of the SFX at a specific volume. /// </summary> /// <param name="clipName"> The sfxclipname that has the audio to be played.</param> public void PlaySFX(SFXClipName clipName, float volumeScale) { _sfxAudioSource.PlayOneShot(_audioClipManager.GetSFXClip(clipName), volumeScale); }
/// <summary> /// Retrieves the audio clip associated with a sfx clip name enum. /// </summary> /// <param name="clipName">The sfx clip enumeration name</param> /// <returns>The audio clip associated</returns> public AudioClip GetSFXClip(SFXClipName clipName) { return(_sfxClips[clipName]); }