implementation of drecon in unity 2022 lts forked from: https://github.com/joanllobera/marathon-envs
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
689 B

using FMODUnity;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CollisionDetection : MonoBehaviour
{
[SerializeField]
private EventReference m_FootstepAudio;
// Start is called before the first frame update
public delegate void onContactSoundDelegate(GameObject obj, float force, EventReference soundObject);
public static onContactSoundDelegate m_PlaySoundOnContact;
private void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.name == "200x200")
{
m_PlaySoundOnContact?.Invoke(this.gameObject, collision.relativeVelocity.magnitude, m_FootstepAudio);
}
}
}