public void Play(Audio.Clip type, float volume = 1, float stereoPan = 0) { source.clip = GetClip(type); source.volume = volume; source.panStereo = stereoPan; source.Play(); GetComponent <AudioSource>().PlayOneShot(source.clip); }
public AudioClip GetClip(Audio.Clip type) { return(sounds.Find(s => s.clip.Equals(type)).audio); }