Hello, I am using asset bundles for the project that I currently work on and on occasions loading assets dynamically from the bundles is required, which I load by using LoadAssetAsync.
The problem arises when a scene that contains an object that was loading its parts (meshes/materials) dynamically gets destroyed before the object fully loads. For the record scene transitions are additive and when the new scene is ready the old one is discarded.
After doing that when I go back to that scene (or any scene that contains the same object) the object fails to fully load all of its parts, some parts are getting loaded others are not. The culprit is the LoadAssetAsync request, which finishes but the asset it contains is null. Sadly no errors are getting printed.
From further investigation I found out that it is the asset that would be loaded that seems to get corrupted in some way. So when the object tries to load an asset that its loading was previously interrupted the problem occurs. There is also a chance that just the prefabs that contain the meshes are having this issue, as the materials that I load the same way seem to be working fine.
Due to how slow LoadAssetAsync is I can't have the user wait on a loading screen until all active loading requests are done, so I do need to interrupt any active loading requests when switching scenes.
This happens on iOS and Mac (haven't checked other devices) on all build types, using Unity 5.3.2f1
↧