Hi guys,
I am using Wwise 2019.1.3 with Unity 2019.2.2
It seems that the current Wwise integration in Unity doesn't create its assets for newly added Wwise objects (Events, SoundBanks etc.) until they are used (selected for a property in the inspector or similar).
And by assets I mean the assets created in the folders within Wwise/Resources/{ObjectType} with long names like for example 1C1B17F2-9A82-46F0-B19E-C825D68D5621.asset.
It is strange because when a Wwise object is deleted in Wwise, its asset is immediately removed in Unity.
The problem is that when the assets for newly created Wwise objects are not created immediately, it can easily lead to conflicts when using version control. For example if two developers both use a newly added event, they will both independently create the event's asset file along with its meta file. This meta file will most likely be different, leading to a conflict. And it is not really convenient to have the audio designer manually select all new Wwise objects in Unity before committing.
I seem to have located the file responsible for updating these assets according to changes in WWUs, namely the AkWwiseWWUBuilder.cs located in Wwise/Editor/WwiseWindows/.
And if I add a single line of code to that file in the function UpdateFiles() at around line 526 (in version 2019.1.3) marked with green below, it seems to create the assets for newly added objects immediately – as desired:
...
foreach (var pair in _WwiseObjectsToAdd)
{
System.Collections.Generic.List<AkWwiseProjectData.AkBaseInformation> removeList = null;
if (!_WwiseObjectsToRemove.TryGetValue(pair.Key, out removeList))
continue;
removeList.Sort(AkWwiseProjectData.AkBaseInformation.CompareByGuid);
foreach (var info in pair.Value)
{
var index = removeList.BinarySearch(info, AkWwiseProjectData.AkBaseInformation.CompareByGuid);
if (index >= 0)
removeList.RemoveAt(index);
WwiseObjectReference.FindOrCreateWwiseObject(pair.Key, info.Name, info.Guid);
}
}
...
But I would rather not modify the integration code, also because it has to be maintained if we update Wwise.
And I am wondering if the current behaviour is intended from Wwise's side, and if there is some issue with my modification that I just haven't thought of... (?)
Does anybody have thoughts on this?
Best, Jakob