public AudioEventClip(AudioClip clip, FloatMinMax volumeMinMax, FloatMinMax pitchMinMax) { this.clip = clip; volume = volumeMinMax.Clamped(0, 1); pitch = pitchMinMax.Clamped(-3, 4); }
public void GetSound(out AudioClip clip, out float volume, out float pitch) { clip = clips[Random.Range(0, clips.Length)]; volume = Random.Range(this.volume.min, this.volume.max); pitch = Random.Range(this.pitch.min, this.pitch.max); }