diff --git a/Assets/_PROJECT/Components/Bolt/Intercation Logic/Car Driving Routine.cs b/Assets/_PROJECT/Components/Bolt/Intercation Logic/Car Driving Routine.cs index ffaca843..2c4b1a9a 100644 --- a/Assets/_PROJECT/Components/Bolt/Intercation Logic/Car Driving Routine.cs +++ b/Assets/_PROJECT/Components/Bolt/Intercation Logic/Car Driving Routine.cs @@ -40,6 +40,7 @@ public class CarDrivingRoutine : MonoBehaviour targetRotationSpeed = rotationSpeed; CarMovement.start(); //starting the car sound here + AudioManager.Instance.SetGlobalParameter("CarPassengerLogic", 0.0f); //change the value of the global parameter in FMOD, initial value } // Update is called once per frame diff --git a/Assets/_PROJECT/Components/Bolt/Intercation Logic/Passanger Seat.cs b/Assets/_PROJECT/Components/Bolt/Intercation Logic/Passanger Seat.cs index 7f1b8bd1..6694562a 100644 --- a/Assets/_PROJECT/Components/Bolt/Intercation Logic/Passanger Seat.cs +++ b/Assets/_PROJECT/Components/Bolt/Intercation Logic/Passanger Seat.cs @@ -5,6 +5,7 @@ using Unity.XR.CoreUtils; using UnityEngine; using UnityEngine.XR.Content.Interaction; using UnityEngine.XR.Interaction.Toolkit; +using FMODUnity; public class PassangerSeat : LocomotionProvider { @@ -36,9 +37,9 @@ public class PassangerSeat : LocomotionProvider Transform cameraTransform = cameraChild.transform.parent.transform; Vector3 cameraShift = cameraTransform.localPosition; - - AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.DoorOpen, gameObject); - + + AudioManager.Instance.SetGlobalParameter("CarPassengerLogic", 2.0f); //change the value of the global parameter in FMOD, changed value + AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.DoorOpen, gameObject); //play 3d oneshot currentPassanger = player; player.transform.SetParent(this.transform); player.transform.localPosition = -cameraShift; @@ -76,8 +77,8 @@ public class PassangerSeat : LocomotionProvider if (cameraChild == null) return; Transform cameraTransform = cameraChild.transform.parent.transform; - - AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.DoorClose, gameObject); + AudioManager.Instance.SetGlobalParameter("CarPassengerLogic", 0.0f); //change the value of the global parameter in FMOD, initial value + AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.DoorClose, gameObject); //play 3d oneshot // Set the player�s parent to null (making it part of the scene hierarchy) currentPassanger.transform.SetParent(null); diff --git a/Assets/_PROJECT/Components/Drawing/Scripts/SprayGun.cs b/Assets/_PROJECT/Components/Drawing/Scripts/SprayGun.cs index ab18e037..f3c5b3c1 100644 --- a/Assets/_PROJECT/Components/Drawing/Scripts/SprayGun.cs +++ b/Assets/_PROJECT/Components/Drawing/Scripts/SprayGun.cs @@ -19,17 +19,24 @@ namespace _PROJECT.Components.Drawing private float _cooldownTimer = 0f; private bool _isSpraying; - private EventInstance spray_sound; + private EventInstance spray_sound; + + + void Start() + { + spray_sound = AudioManager.Instance.CreateInstance(FMODEvents.Instance.Spray); //creating the instance through AudioManager + spray_sound.setParameterByName("SpraySwitcher", 0); //"Spray - 0 in FMOD" + spray_sound.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(sprayPoint)); //setting the 3D attributes + } protected override void OnActivated(ActivateEventArgs args) { base.OnActivated(args); StartSpray(); - spray_sound = AudioManager.Instance.CreateInstance(FMODEvents.Instance.Spray); + spray_sound.start(); //starting the instance spray_sound.setParameterByName("SpraySwitcher", 0); //"Spray - 0 in FMOD" - spray_sound.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(sprayPoint)); - spray_sound.start(); + } protected override void OnDeactivated(DeactivateEventArgs args) @@ -38,7 +45,6 @@ namespace _PROJECT.Components.Drawing StopSpray(); spray_sound.setParameterByName("SpraySwitcher", 1); //"NoSpray - 1 in FMOD" - spray_sound.release(); } private new void Awake() @@ -47,6 +53,7 @@ namespace _PROJECT.Components.Drawing sprayPart.Stop(true, ParticleSystemStopBehavior.StopEmitting); _isSpraying = false; _layerMask = 1 << LayerMask.NameToLayer("Paintable"); + } private void StartSpray() @@ -74,7 +81,7 @@ namespace _PROJECT.Components.Drawing { if (_isSpraying) { - spray_sound.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(sprayPoint)); + spray_sound.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(sprayPoint)); //changing the attributes } if (!isSelected || !_isSpraying) @@ -83,7 +90,6 @@ namespace _PROJECT.Components.Drawing sprayPart.Stop(true, ParticleSystemStopBehavior.StopEmitting); spray_sound.setParameterByName("SpraySwitcher", 1); //"NoSpray - 1 in FMOD" - spray_sound.release(); _isSpraying = false; return; diff --git a/Assets/_PROJECT/Components/Elevator/Scripts/Elevator outer.cs b/Assets/_PROJECT/Components/Elevator/Scripts/Elevator outer.cs index 7250bee4..f003658d 100644 --- a/Assets/_PROJECT/Components/Elevator/Scripts/Elevator outer.cs +++ b/Assets/_PROJECT/Components/Elevator/Scripts/Elevator outer.cs @@ -53,6 +53,7 @@ public class ElevatorOuter : MonoBehaviour public void OpenDoors() { arrivalBeeper.Play(); + AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.ElevatorArrival, gameObject); Debug.Log("Outer Doors opened"); StartCoroutine(MoveDoors(leftDoor, leftDoorOpenPos, rightDoor, rightDoorOpenPos, doorOpenTime)); diff --git a/Assets/_PROJECT/Components/NewHandPresence/Prefabs/Scripts/Continuos locomotion Conf.cs b/Assets/_PROJECT/Components/NewHandPresence/Prefabs/Scripts/Continuos locomotion Conf.cs index 9920c2d4..dfa4b4a7 100644 --- a/Assets/_PROJECT/Components/NewHandPresence/Prefabs/Scripts/Continuos locomotion Conf.cs +++ b/Assets/_PROJECT/Components/NewHandPresence/Prefabs/Scripts/Continuos locomotion Conf.cs @@ -25,6 +25,7 @@ public class ContinuoslocomotionConfigurator : MonoBehaviour private void enableLocomotion() { + AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Click, gameObject); //3d oneshot sound locomotion.enabled = true; turnOnButton.gameObject.SetActive(false); turnOffButton.gameObject.SetActive(true); @@ -32,6 +33,7 @@ public class ContinuoslocomotionConfigurator : MonoBehaviour private void disableLocomotion() { + AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Click, gameObject); //3d oneshot sound locomotion.enabled = false; turnOnButton.gameObject.SetActive(true); turnOffButton.gameObject.SetActive(false); diff --git a/Assets/_PROJECT/Components/NewHandPresence/Prefabs/Scripts/HoverSlideButton.cs b/Assets/_PROJECT/Components/NewHandPresence/Prefabs/Scripts/HoverSlideButton.cs index 76d532e3..a0479a6f 100644 --- a/Assets/_PROJECT/Components/NewHandPresence/Prefabs/Scripts/HoverSlideButton.cs +++ b/Assets/_PROJECT/Components/NewHandPresence/Prefabs/Scripts/HoverSlideButton.cs @@ -23,6 +23,7 @@ public class HoverSlideButton : MonoBehaviour, IPointerEnterHandler, IPointerExi public void OnPointerEnter(PointerEventData eventData) { SlideToPosition(onPosition); + AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.Hover, gameObject); //3d oneshot sound } public void OnPointerExit(PointerEventData eventData) diff --git a/Assets/_PROJECT/Components/NewHandPresence/Prefabs/Scripts/Menu Teleport Button.cs b/Assets/_PROJECT/Components/NewHandPresence/Prefabs/Scripts/Menu Teleport Button.cs index a42fe70a..18b859ac 100644 --- a/Assets/_PROJECT/Components/NewHandPresence/Prefabs/Scripts/Menu Teleport Button.cs +++ b/Assets/_PROJECT/Components/NewHandPresence/Prefabs/Scripts/Menu Teleport Button.cs @@ -6,6 +6,7 @@ using UnityEngine; using UnityEngine.Rendering; using UnityEngine.UI; using UnityEngine.XR.Interaction.Toolkit; +using FMOD.Studio; public class MenuTeleportButton : MonoBehaviour { @@ -20,6 +21,15 @@ public class MenuTeleportButton : MonoBehaviour private Button button; private TeleportLocation target; // Target teleport position + private EventInstance TeleportingSound; + + private void Awake() + { + TeleportingSound = AudioManager.Instance.CreateInstance(FMODEvents.Instance.Teleport); //initialise the instance + + } + + void Start() { button = GetComponent