Feat : Wwise Integration

This commit is contained in:
Alex
2026-03-23 14:28:21 +01:00
parent 627d787695
commit 004bc328ed
1149 changed files with 226567 additions and 19 deletions
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5a524b5f9266e0b4284b3fc92182fe8f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,19 @@
{
"name": "AK.Wwise.Unity.Utilities",
"rootNamespace": "",
"references": [
"AK.Wwise.Unity.Logging"
],
"includePlatforms": [],
"excludePlatforms": [
"Lumin",
"Stadia"
],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f11150c1c2477354cbf34136facf4aeb
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,66 @@
/*******************************************************************************
The content of this file includes portions of the proprietary AUDIOKINETIC Wwise
Technology released in source code form as part of the game integration package.
The content of this file may not be used without valid licenses to the
AUDIOKINETIC Wwise Technology.
Note that the use of the game engine is subject to the Unity(R) Terms of
Service at https://unity3d.com/legal/terms-of-service
License Usage
Licensees holding valid licenses to the AUDIOKINETIC Wwise Technology may use
this file in accordance with the end user license agreement provided with the
software or, alternatively, in accordance with the terms contained
in a written agreement between you and Audiokinetic Inc.
Copyright (c) 2026 Audiokinetic Inc.
*******************************************************************************/
using System;
using UnityEngine;
using AK.Wwise.Unity.Logging;
public static class AkDelegates
{
/// <summary>
/// Invokes a parameterless Action, safely handling null/destroyed UnityEngine.Object targets.
/// Automatically unsubscribes destroyed Unity objects.
/// </summary>S
/// <param name="action">The Action to invoke.</param>
public static void InvokeUnitySafe(this System.Action action)
{
if (action == null) return;
Delegate[] subscribers = action.GetInvocationList();
foreach (Delegate del in subscribers)
{
// Check if the delegate's target is a UnityEngine.Object
if (del.Target is UnityEngine.Object unityTarget)
{
// If the Unity object is null/destroyed, unsubscribe and skip
if (unityTarget == null)
{
WwiseLogger.Log($"Removing stale delegate from Action. Method: {del.Method.Name}, Target ID: {unityTarget.GetInstanceID()}");
action -= (Action)del;
continue;
}
}
try
{
((Action)del).Invoke();
}
catch (MissingReferenceException missingReferenceException)
{
WwiseLogger.Error($"Missing Reference Exception caught during safe Invoke. Method: {del.Method.Name}. Error: {missingReferenceException.Message}");
if (del.Target is UnityEngine.Object unityTargetOnException && unityTargetOnException == null)
{
action -= (Action)del;
}
}
catch (Exception ex)
{
WwiseLogger.Error($"Unexpected exception during safe Invoke. Method: {del.Method.Name}. Error: {ex.Message}");
}
}
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: b860aa6c335e71f489b04e0e15f34fcf
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: f949d4cdc9ff15e41b4d3aeb40833bb7