Unity-Technologies / UnityDataTools

Experimental tools and libraries for reading and analyzing Unity data files.
Other
577 stars 50 forks source link

Crashing when data files containt SerializeReferences #4

Closed francis-page closed 2 years ago

francis-page commented 2 years ago

The tool will crash when there are SerializeReferences. There is a missing API in the UnityDataFileApi dynamic library and this will require some time to fix it. There is unfortunately no known workaround.

MrTinto commented 2 years ago

Is there any update on this?

What leads to there being SerializeReferences in the asset bundles? Is there anything that can be done on the Unity side to prevent them from occurring (e.g. best practices), so the tool will work?

We are seeing a lot of asset bundles failing to be processed successfully by the tool, giving us only this output:

Processing 100% (1/1) name_of_bundle.assetbundle
Error processing file name_of_bundle.assetbundle

And I'm wondering if it could be related to what you said above. We are about to investigate in more depth the nature of the error as, as you can see, the output from the tool doesn't offer any guidance as to what could be wrong.

francis-page commented 2 years ago

@MrTinto SerializeReference is a Unity feature. They will be in the data only if you use them.

I don't know if the error you get is caused by this though. I started working on this issue, you can try to check out the "add-serialize-reference-support" branch and see if it works. I also added better error handling so if it still fails, you should be able to get more details.

I'm actively working on this branch so I can't give you any guarantee about its stability.

francis-page commented 2 years ago

The issue is now fixed. A missing API was added in the UnityFileSystemApi dynamic library, but this change has not been integrated into Unity yet. The library included in this repository has the new API so you must use it otherwise the tool will fail.