void PlayFootstepSoundEvent() { if (!AudioSourceFootstep.isPlaying) { Clip x = FootstepClipSet.GetRandomClip(); AudioSourceFootstep.clip = x.AudioClip; AudioSourceFootstep.volume = x.volume; AudioSourceFootstep.Play(); } }
void PlayClipAtPointFromClipSetInPosition(ClipSet x) { AudioSource newAudioSource = new GameObject("DeathAudioSource", typeof(AudioSource)).GetComponent <AudioSource>(); AudioClip clip = x.GetRandomClip().AudioClip; newAudioSource.clip = clip; newAudioSource.outputAudioMixerGroup = audioMixer; newAudioSource.Play(); Destroy(newAudioSource.gameObject, clip.length); }
void PlayFromClipSet(ClipSet clipset) { Clip x = clipset.GetRandomClip(); audioSource.PlayOneShot(x.AudioClip, x.volume); }