using System.Collections.Generic; using UnityEngine; public class PlayerSound : MonoBehaviour { private List _hitClips; private List _wooshClips; private List _footStepSounds; public void initalize(List hitClips, List wooshClips, List footStepSounds) { _hitClips = hitClips; _wooshClips = wooshClips; _footStepSounds = footStepSounds; } public void playHitSound() { AudioSource.PlayClipAtPoint(_hitClips[Random.Range(0, _hitClips.Count)], transform.position, 0.25f); } public void playWooshSound() { AudioSource.PlayClipAtPoint(_wooshClips[Random.Range(0, _wooshClips.Count)], transform.position, 0.25f); } public void playFootStepSound() { AudioSource.PlayClipAtPoint(_footStepSounds[Random.Range(0, _footStepSounds.Count)], transform.position, 1f); } }