/******************************************************************************* 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.Collections.Generic; using UnityEngine; using UnityEngine.Serialization; public class AkWwiseProjectData { [FormerlySerializedAs("AcousticTextureWwu")] public System.Collections.Generic.List AcousticTextureRoot = new System.Collections.Generic.List(); [FormerlySerializedAs("AuxBusWwu")] public System.Collections.Generic.List BusRoot = new System.Collections.Generic.List(); [FormerlySerializedAs("BankWwu")] public System.Collections.Generic.List BankRoot = new System.Collections.Generic.List(); [FormerlySerializedAs("EventWwu")] public System.Collections.Generic.List EventRoot = new System.Collections.Generic.List(); [FormerlySerializedAs("RtpcWwu")] public System.Collections.Generic.List GameParameterRoot = new System.Collections.Generic.List(); [FormerlySerializedAs("StateWwu")] public System.Collections.Generic.List StateRoot = new System.Collections.Generic.List(); [FormerlySerializedAs("SwitchWwu")] public System.Collections.Generic.List SwitchRoot = new System.Collections.Generic.List(); [FormerlySerializedAs("TriggerWwu")] public System.Collections.Generic.List TriggerRoot = new System.Collections.Generic.List(); ////Contains the int id of all items that are expanded in the Wwise picker public System.Collections.Generic.List ExpandedFileSystemItemIds = new System.Collections.Generic.List(); public System.Collections.Generic.List ExpandedWaapiItemIds = new System.Collections.Generic.List(); public bool AutoSyncSelection; public string CurrentPluginConfig; public float GetEventMaxAttenuation(uint eventID) { var Event = GetEventInfo(eventID); return Event != null ? Event.maxAttenuation : 0.0f; } public Event GetEventInfo(uint eventID) { foreach (var root in EventRoot) { var found = root.Find(eventID); if (found != null) { return found as Event; } } return null; } public void Reset() { EventRoot = new System.Collections.Generic.List(); StateRoot = new System.Collections.Generic.List(); SwitchRoot = new System.Collections.Generic.List(); BankRoot = new System.Collections.Generic.List(); BusRoot = new System.Collections.Generic.List(); GameParameterRoot = new System.Collections.Generic.List(); TriggerRoot = new System.Collections.Generic.List(); AcousticTextureRoot = new System.Collections.Generic.List(); } [System.Serializable] public class ByteArrayWrapper { public byte[] bytes; public ByteArrayWrapper(byte[] byteArray) { bytes = byteArray; } public static implicit operator ByteArrayWrapper(System.Guid guid) => new ByteArrayWrapper(guid.ToByteArray()); public static implicit operator System.Guid(ByteArrayWrapper bytes) => new System.Guid(bytes.bytes); } private static System.Guid GetGuid(byte[] bytes) { try { return new System.Guid(bytes); } catch { return System.Guid.Empty; } } [System.Serializable] public class AkBaseInformation : System.IComparable { [UnityEngine.SerializeField] [UnityEngine.Serialization.FormerlySerializedAs("Name")] private string name; public string Name { get { return name; } set { name = value; id = AkUtilities.ShortIDGenerator.Compute(value); } } private System.Guid guid; public System.Guid Guid { get { return guid; } set { guid = value; } } [UnityEngine.SerializeField] [UnityEngine.Serialization.FormerlySerializedAs("ID")] private uint id; public uint Id { get { return id; } set { id = value; } } [UnityEngine.HideInInspector] public System.Collections.Generic.List PathAndIcons = new System.Collections.Generic.List(); int System.IComparable.CompareTo(object other) { if (other == null) return 1; var otherAkInformation = other as AkBaseInformation; if (otherAkInformation == null) throw new System.ArgumentException("Object is not of type AkBaseInformation"); return Name.CompareTo(otherAkInformation.Name); } private class _CompareByGuid : System.Collections.Generic.IComparer { int System.Collections.Generic.IComparer.Compare(AkBaseInformation a, AkBaseInformation b) { if (a == null) return b == null ? 0 : -1; return a.Guid.CompareTo(b.Guid); } } public static System.Collections.Generic.IComparer CompareByGuid = new _CompareByGuid(); } [System.Serializable] public class WwiseTreeObject : AkBaseInformation { public string Path; public List Children; public WwiseObjectType Type = WwiseObjectType.Folder; public WwiseTreeObject Find(uint shortId) { if (Id == shortId) { return this; } if (Children == null) { return null; } foreach(var Child in Children) { var found = Child.Find(shortId); if (found != null) { return found; } } return null; } } [System.Serializable] public class Event : WwiseTreeObject { public float maxAttenuation; public float maxDuration = -1; public float minDuration = -1; } [System.Serializable] public class PathElement { public string ElementName; public WwiseObjectType ObjectType; public string Path; [UnityEngine.SerializeField] [UnityEngine.HideInInspector] private byte[] guid = null; public System.Guid ObjectGuid { get { return GetGuid(guid); } set { guid = value.ToByteArray(); } } public PathElement(string Name, WwiseObjectType objType, System.Guid guid) { ElementName = Name; ObjectType = objType; ObjectGuid = guid; } public static string GetProjectPathString(System.Collections.Generic.List pathElements, int index) { string path = ""; for (int i = 0; i<=index && i < pathElements.Count; i++) { path += $"/{pathElements[i].ElementName}"; } return path; } } }