public void PlayClip(SfxGroup group) { AudioSource source = Pool.Grab(); source.clip = group.GetClip(); source.volume = UnityEngine.Random.Range(group.VolumeRange.x, group.VolumeRange.y); source.pitch = UnityEngine.Random.Range(group.PitchRange.x, group.PitchRange.y); source.Play(); StartCoroutine(ReturnToPool(source)); }
public static void Play(SfxGroup group) { instance.PlayClip(group); }