using System.Linq; using UnityEngine; using Wwise.Wooduan.ScriptableObjects; public partial class AkUtilities { public static string GetPathInPackage(string relativePath) { const string AssetWwisePathParent = "Assets/Wwise/API/"; const string PackageWwisePathParent = "Packages/com.soc.plugin.wwise.wooduan/"; string rootpath = ""; if (System.IO.Directory.Exists(System.IO.Path.GetFullPath(PackageWwisePathParent))) { rootpath = PackageWwisePathParent; } else if (System.IO.Directory.Exists(System.IO.Path.GetFullPath(AssetWwisePathParent))) { rootpath = AssetWwisePathParent; } else { return string.Empty; } var relativePathFolders = new System.Collections.Generic.List(relativePath.Split('/')); var rootPathFolders = new System.Collections.Generic.List(rootpath.Split('/')); var overlap = relativePathFolders.Intersect(rootPathFolders); if (overlap.Count() > 0) { UnityEngine.Debug.LogWarning("AkUtilities.GetPathInPackage(): relativePath contains overlapping folder names with root path.\nrelativePath: " + relativePath + "\nroot path: " + rootpath + "\n This could cause issues with plugins activation and packaging."); } return System.IO.Path.Combine(rootpath, relativePath); } public static void LoadAudioInitData() { var config = Resources.Load("Wwise/AudioInitLoadData"); if (config) config.LoadAudioData(); } }