Beispiel #1
0
 void PlayFootstepSoundEvent()
 {
     if (!AudioSourceFootstep.isPlaying)
     {
         Clip x = FootstepClipSet.GetRandomClip();
         AudioSourceFootstep.clip   = x.AudioClip;
         AudioSourceFootstep.volume = x.volume;
         AudioSourceFootstep.Play();
     }
 }
Beispiel #2
0
    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);
    }
Beispiel #3
0
    void PlayFromClipSet(ClipSet clipset)
    {
        Clip x = clipset.GetRandomClip();

        audioSource.PlayOneShot(x.AudioClip, x.volume);
    }