Files
drecon-unity/Assets/8_Scripts/1_Managers/AgentManager.cs
2024-04-09 16:45:05 +01:00

25 lines
538 B
C#

using FMODUnity;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AgentManager : MonoBehaviour
{
[SerializeField]
private void OnEnable()
{
CollisionDetection.m_PlaySoundOnContact += PlayOneShot;
}
private void OnDisable()
{
CollisionDetection.m_PlaySoundOnContact -= PlayOneShot;
}
private void PlayOneShot(GameObject obj, float force, EventReference sound)
{
AudioManager.instance.PlayOneShotAttached(sound, obj, force);
}
}