occlusion for 5 sounds added, new sounds were added, however the issue with the layer of glass walls has to be resolved
This commit is contained in:
@@ -26,7 +26,6 @@ public class TeleportationListen : MonoBehaviour
|
||||
|
||||
private void OnTeleportEnd(LocomotionSystem locomotionSystem)
|
||||
{
|
||||
// ✅ Fires ONLY when teleportation successfully completes
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Steps, gameObject); //oneshot 3d event
|
||||
|
||||
Debug.Log("[TeleportationListen] Teleport sound played.");
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
using _PROJECT.NewHandPresence;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.XR.Interaction.Toolkit;
|
||||
|
||||
public class TutorialAudioListener : MonoBehaviour
|
||||
{
|
||||
[Header("References")]
|
||||
[SerializeField] private TutorialController tutorialController;
|
||||
|
||||
private InputAction moveAction;
|
||||
private InputAction turnAction;
|
||||
private TeleportationProvider teleportationProvider;
|
||||
|
||||
private float lastStepTime;
|
||||
[SerializeField] private float stepCooldown = 0.5f; // seconds between steps
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (tutorialController == null)
|
||||
{
|
||||
tutorialController = FindObjectOfType<TutorialController>();
|
||||
}
|
||||
|
||||
if (tutorialController != null)
|
||||
{
|
||||
moveAction = tutorialController.moveProvider.leftHandMoveAction.action;
|
||||
turnAction = tutorialController.turnProvider.rightHandSnapTurnAction.action;
|
||||
teleportationProvider = tutorialController.teleportProvider;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Debug.LogError("[TutorialAudioListener] No TutorialController found!");
|
||||
}
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
if (moveAction != null)
|
||||
moveAction.performed += OnMovePerformed;
|
||||
|
||||
if (turnAction != null)
|
||||
turnAction.performed += OnTurnPerformed;
|
||||
|
||||
if (teleportationProvider != null)
|
||||
teleportationProvider.endLocomotion += OnTeleportEnd;
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
if (moveAction != null)
|
||||
moveAction.performed -= OnMovePerformed;
|
||||
|
||||
if (turnAction != null)
|
||||
turnAction.performed -= OnTurnPerformed;
|
||||
|
||||
if (teleportationProvider != null)
|
||||
teleportationProvider.endLocomotion -= OnTeleportEnd;
|
||||
}
|
||||
|
||||
private void OnMovePerformed(InputAction.CallbackContext context)
|
||||
{
|
||||
// Only play a sound if enough time has passed since the last one
|
||||
if (Time.time - lastStepTime < stepCooldown)
|
||||
return;
|
||||
|
||||
lastStepTime = Time.time;
|
||||
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.StepOverall, gameObject);
|
||||
}
|
||||
|
||||
private void OnTurnPerformed(InputAction.CallbackContext context)
|
||||
{
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.StepSpin, gameObject);
|
||||
//Debug.Log("[TutorialAudioListener] Turn sound played.");
|
||||
}
|
||||
|
||||
private void OnTeleportEnd(LocomotionSystem locomotionSystem)
|
||||
{
|
||||
//TeleportationListen plays the required sound. To play it here, unattach the TeleportationListen.cs script.
|
||||
|
||||
|
||||
//AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Steps, gameObject);
|
||||
//Debug.Log("[TutorialAudioListener] Teleport sound played.");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ca400fa6ff24b104190032fa85eedf91
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user