working build confirmed before tipilan, a few changes to ui and bow, order of audiomanager and fmodevents changed

This commit is contained in:
Timur Nizamov
2025-10-22 21:10:56 +03:00
parent 5623167eb9
commit f2475e6b06
33 changed files with 534 additions and 86 deletions

View File

@@ -30,6 +30,12 @@ public class CarDrivingRoutine : MonoBehaviour
private void Awake()
{
Debug.LogError("AUDIO MANAGER:");
Debug.LogError(AudioManager.Instance);
Debug.LogError("FMOD EVENTS INSTANCE:");
Debug.LogError(FMODEvents.Instance);
Debug.LogError("Car Simple Driving:");
Debug.LogError(FMODEvents.Instance.BoltCarSimpleDriving);
CarMovement = AudioManager.Instance.CreateInstance(FMODEvents.Instance.BoltCarSimpleDriving); //initialising the variable
CarMovement.setParameterByName("EasyBoltLogic", 0); //"Driving - 0 in FMOD"
CarMovement.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(gameObject)); //setting 3d attributes

View File

@@ -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.");
}
}

View File

@@ -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.");
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6bdaa08e302fd9a4ab0f386f25762231
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -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}

View File

@@ -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: []

View File

@@ -1691,8 +1691,8 @@ GameObject:
- component: {fileID: 2403481060362975301}
- component: {fileID: 150987804393607111}
- component: {fileID: 2849620166313326850}
- component: {fileID: 5954151782133518590}
- component: {fileID: 3623653364064856318}
- component: {fileID: 7579737766687674392}
m_Layer: 0
m_Name: NetworkManagerUI
m_TagString: Untagged
@@ -1783,7 +1783,15 @@ MonoBehaviour:
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!114 &5954151782133518590
--- !u!81 &3623653364064856318
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8920648335286241163}
m_Enabled: 1
--- !u!114 &7579737766687674392
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
@@ -1806,14 +1814,6 @@ MonoBehaviour:
networkDiscovery: {fileID: 0}
uiCamera: {fileID: 0}
placeholderAudioListener: {fileID: 0}
--- !u!81 &3623653364064856318
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8920648335286241163}
m_Enabled: 1
--- !u!1 &8930421849167053048
GameObject:
m_ObjectHideFlags: 0

View File

@@ -4,7 +4,7 @@ MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
executionOrder: -20
icon: {instanceID: 0}
userData:
assetBundleName:

View File

@@ -4,7 +4,7 @@ MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
executionOrder: -10
icon: {instanceID: 0}
userData:
assetBundleName: