using System; using System.Collections.Generic; using System.IO; using AK.Wwise; using UnityEditor; using Wwise.Wooduan.Tools; public partial class AkWwiseProjectData { public static Guid FindWwiseGroupObjectChildGuid(string name, GroupValue objGroup) { foreach (var value in objGroup.values) if (value.Name == name) return value.Guid; return Guid.Empty; } public static string FindWwiseGroupObjectChildName(Guid guid, GroupValue objGroup) { foreach (var value in objGroup.values) if (value.Guid == guid) return value.Name; return string.Empty; } private IEnumerable GetGroupWorkUnit() { if (typeof(T) == typeof(State)) return StateWwu; if (typeof(T) == typeof(Switch)) return SwitchWwu; return null; } private IEnumerable GetWorkUnit() { if (typeof(T) == typeof(Bank)) return BankWwu; if (typeof(T) == typeof(RTPC)) return RtpcWwu; if (typeof(T) == typeof(AuxBus)) return AuxBusWwu; if (typeof(T) == typeof(Trigger)) return TriggerWwu; return null; } public AkInformation FindWwiseObject(string objectName) where T : BaseType { foreach (var t in GetWorkUnit()) { var e = t.List.Find(x => x.Name.Equals(objectName)); if (e != null) return e; } return null; } public AkInformation FindWwiseObject(Guid objectGuid) where T : BaseType { foreach (var t in GetWorkUnit()) { var e = t.List.Find(x => x.Guid.Equals(objectGuid)); if (e != null) return e; } return null; } public GroupValue FindWwiseGroupUnit(string groupName) where T : BaseGroupType { foreach (var t in GetGroupWorkUnit()) { var s = t.List.Find(x => x.Name.Equals(groupName)); if (s != null) return s; } return null; } public GroupValue FindWwiseGroupUnit(Guid groupGuid) where T : BaseGroupType { foreach (var t in GetGroupWorkUnit()) { var s = t.List.Find(x => x.Guid.Equals(groupGuid)); if (s != null) return s; } return null; } }