Hello!
I have an asset database, and I’d like to add certain assets to that database during OnWillSaveAssets. Part of that step is serializing out the databaseId to that asset. However, I’m noticing that I don’t seem to be able to make any changes to the asset at that time - any changes made look to be overwritten by whatever state the asset was in before OnWillSaveAssets was called.
I tried setting the Id value by digging out the desired behaviour, setting it directly, and using EditorUtility.SetDirty(); as well as by creating a serialized object, modifying the property, and using ApplyModifyProperties. Neither worked.
I have a backup plan to just queue a round of modification/save to another tool after OnWillSaveAssets is complete, but I’d rather be able to just edit the asset directly. Is there a special way to tell the asset database that the asset its about to save has changed or is this not possible?