footstep audio added
This commit is contained in:
24
Assets/8_Scripts/1_Managers/AgentManager.cs
Normal file
24
Assets/8_Scripts/1_Managers/AgentManager.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
11
Assets/8_Scripts/1_Managers/AgentManager.cs.meta
generated
Normal file
11
Assets/8_Scripts/1_Managers/AgentManager.cs.meta
generated
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8c398b676a196214e9a3612ad50bcd56
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -37,6 +37,12 @@ public class AudioManager : MonoBehaviour
|
||||
return soundInst;
|
||||
}
|
||||
|
||||
// Physic's based sounds
|
||||
public void PlayOneShotAttached(EventReference sound, GameObject obj, float force)
|
||||
{
|
||||
RuntimeManager.PlayOneShotAttached(sound, obj, force, 0.1f);
|
||||
}
|
||||
|
||||
public void StopSound(EventInstance soundInst)
|
||||
{
|
||||
soundInst.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
|
||||
|
||||
@@ -11,7 +11,6 @@ public class SubtitleManager : MonoBehaviour
|
||||
[Header("Text")]
|
||||
public TMP_Text m_Text;
|
||||
[Header("Audio")]
|
||||
[Header("Audio")]
|
||||
[SerializeField]
|
||||
private EventReference m_NarrationSFX;
|
||||
[SerializeField]
|
||||
|
||||
Reference in New Issue
Block a user