fix : Wwise global guard

This commit is contained in:
2026-05-28 13:24:06 +02:00
parent 5f3a9cb516
commit 11e5ce3a64
4 changed files with 277 additions and 9 deletions
File diff suppressed because one or more lines are too long
+13
View File
@@ -4292,6 +4292,7 @@ GameObject:
m_Component: m_Component:
- component: {fileID: 473823046} - component: {fileID: 473823046}
- component: {fileID: 473823045} - component: {fileID: 473823045}
- component: {fileID: 473823047}
m_Layer: 0 m_Layer: 0
m_Name: WwiseGlobal m_Name: WwiseGlobal
m_TagString: Untagged m_TagString: Untagged
@@ -4339,6 +4340,18 @@ Transform:
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &473823047
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 473823044}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a732b4b9bbfc16c4ab4d5c50a810287d, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::WwiseGlobalGuard
--- !u!1 &478876090 --- !u!1 &478876090
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -0,0 +1,14 @@
using UnityEngine;
public class WwiseGlobalGuard : MonoBehaviour
{
void Awake()
{
if (FindObjectsByType<WwiseGlobalGuard>(FindObjectsSortMode.None).Length > 1)
{
Destroy(gameObject);
return;
}
DontDestroyOnLoad(gameObject);
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: a732b4b9bbfc16c4ab4d5c50a810287d