Open hybridherbst opened 2 years ago
This seems to do the trick, instead of the static constructor:
[InitializeOnLoadMethod]
static void Init()
{
var r = DllWrapper.Init();
HandleErrors(r);
AssemblyReloadEvents.beforeAssemblyReload += () => DllWrapper.Cleanup();
}
Thank you for reporting this. To be honest, I did not design the code to work inside Unity. I will see if I can find a way to fix it so it can work inside or outside Unity without any change.
The above is already enough to get it working in Unity! Could use an ifdef so that the functionality works both in and outside Unity.
Also, it would be interesting to have examples for parsing files with it – I was successfully able to parse many of the asset database artifacts, but I wasn't able to parse scene files, for example (as they seem to live inside memory, not on disk).
I tried using these tools from inside Unity to analyze import artifacts and for build postprocessors of generated data, which to be best of my understanding fall under
SerializedFile
.However, it seems that the app doesn't properly work with domain load and unload, after a first attempt I'm always getting
for subsequent tries. Are there plans to get this to work?
I found a relevant comment in the UnityFileSystem constructor that leads me to believe this is a bug / not implemented: