using System.Collections; using System.Collections.Generic; using UnityEngine; #if FMOD_AVAILABLE using FMOD; using FMODUnity; #endif [RequireComponent(typeof(Rigidbody))] public class OnCollideSound : MonoBehaviour { [SerializeField] EventReference soundRef; [SerializeField] float minVelocity = 0.1f; [SerializeField] List specialTags = new List(); [SerializeField] List specialSounds = new List(); private bool _specialCase = false; private Rigidbody _rigidbody; private void Start() { _rigidbody = GetComponent(); } private void OnCollisionEnter(Collision collision) { if (_rigidbody.velocity.magnitude >= minVelocity) { for(int i=0; i