working build confirmed before tipilan, a few changes to ui and bow, order of audiomanager and fmodevents changed
This commit is contained in:
@@ -7,6 +7,7 @@ using UnityEngine.Rendering;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.XR.Interaction.Toolkit;
|
||||
using FMOD.Studio;
|
||||
using FMODUnity;
|
||||
|
||||
public class MenuTeleportButton : MonoBehaviour
|
||||
{
|
||||
@@ -22,10 +23,12 @@ public class MenuTeleportButton : MonoBehaviour
|
||||
private TeleportLocation target; // Target teleport position
|
||||
|
||||
private EventInstance TeleportingSound;
|
||||
FMOD.Studio.Bus SpecialBus; //FMOD bus variable
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
TeleportingSound = AudioManager.Instance.CreateInstance(FMODEvents.Instance.Teleport); //initialise the instance
|
||||
SpecialBus = FMODUnity.RuntimeManager.GetBus("bus:/LogicalMute");
|
||||
|
||||
}
|
||||
|
||||
@@ -102,6 +105,21 @@ public class MenuTeleportButton : MonoBehaviour
|
||||
button.interactable = false;
|
||||
button.interactable = true;
|
||||
|
||||
StartCoroutine(MuteBusForSeconds(1.5f));
|
||||
|
||||
TeleportingSound.start(); //playing 2d oneshot
|
||||
}
|
||||
|
||||
private IEnumerator MuteBusForSeconds(float duration)
|
||||
{
|
||||
// Lower volume to 0 instantly
|
||||
SpecialBus.setVolume(0f);
|
||||
Debug.Log("[MenuTeleportButton] Muting LogicalMute bus...");
|
||||
|
||||
yield return new WaitForSeconds(duration);
|
||||
|
||||
// Restore volume
|
||||
SpecialBus.setVolume(1f);
|
||||
Debug.Log("[MenuTeleportButton] Unmuted LogicalMute bus.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.XR.Interaction.Toolkit;
|
||||
using FMOD.Studio;
|
||||
|
||||
[RequireComponent(typeof(TeleportationProvider))]
|
||||
public class TeleportationListen : MonoBehaviour
|
||||
{
|
||||
private TeleportationProvider teleportationProvider;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
teleportationProvider = GetComponent<TeleportationProvider>();
|
||||
|
||||
}
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
// Subscribe to the event that fires when teleportation actually ends
|
||||
teleportationProvider.endLocomotion += OnTeleportEnd;
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
teleportationProvider.endLocomotion -= OnTeleportEnd;
|
||||
}
|
||||
|
||||
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,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6bdaa08e302fd9a4ab0f386f25762231
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -28,6 +28,7 @@ Transform:
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 0.05, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 7931660231731467089}
|
||||
m_RootOrder: 1
|
||||
@@ -51,6 +52,7 @@ MeshRenderer:
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
@@ -109,6 +111,7 @@ Transform:
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0.555, z: 0}
|
||||
m_LocalScale: {x: 0.7, y: 0.5, z: 0.7}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 7931660231731467089}
|
||||
m_RootOrder: 0
|
||||
@@ -132,6 +135,7 @@ MeshRenderer:
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
@@ -188,6 +192,7 @@ Transform:
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -76.37219, y: 4.513916, z: -12.719563}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 7931660231006572051}
|
||||
- {fileID: 7931660229594303655}
|
||||
|
||||
@@ -3322,6 +3322,7 @@ GameObject:
|
||||
- component: {fileID: 3674974860896573708}
|
||||
- component: {fileID: 4796162426222032203}
|
||||
- component: {fileID: 3021947512568437509}
|
||||
- component: {fileID: 2252173189162072442}
|
||||
m_Layer: 0
|
||||
m_Name: Locomotion Providers
|
||||
m_TagString: Untagged
|
||||
@@ -3514,6 +3515,18 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 027065c8bd8579b4db62c9b5da6bafb6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!114 &2252173189162072442
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5652728867526489159}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 6bdaa08e302fd9a4ab0f386f25762231, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &5816804138171263384
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -8030,7 +8043,8 @@ PrefabInstance:
|
||||
propertyPath: m_InteractionLayers.m_Bits
|
||||
value: 2164612983
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedComponents:
|
||||
- {fileID: 6816438231733672453, guid: b0b2b7e0bfc3c6347b6aa4f25e1f4901, type: 3}
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
|
||||
Reference in New Issue
Block a user