public void Collide(GameObject other) { if (sfxCollect != null) { sfxCollect.PlayAtSource(other.GetComponent <AudioSource>()); } other.GetComponent <PlayerView>().PlayPulse(); Destroy(gameObject); }
private void PlaySound(SoundClip clip, float volume = 1f, float panOffset = 0f, float pitchOffset = 0f) { clip.PlayAtSource(Audio, volume, panOffset, pitchOffset); }