I am developing a solution to bundle many items separately, and everything except AnimationClip works. I can bundle rigs, skins, textures, meshes, etc all separately in different bundles, and reconstruct them from their bundles after downloading them from the server.
The AnimationClips won’t work, because for some reason Unity does not bundle them correctly. They simply bundle as empty animations. That seems to be an old bug which was never fixed.
As an alternative, I am now bundling the AnimationClips as binary assets – according to Unity - Manual: Storing and loading binary data in an AssetBundle
Now, that sort of works, but Unity seems to lack a final step: load the AnimationClip back from the binary TextAsset… I can bundle the animations as binary TextAssets inside their individual bundles, and I confirmed that the binary asset indeed contains the AnimationClip bytes, because if I load the TextAsset from the bundle, and File.WriteAllBytes() those bytes to a .asset, I can later on load the AnimationClip using Resources.Load() – not in the same running session, though. But that is obviously not a complete solution, that is an ugly hack, and I need to reconstruct the AnimationClip from the TextAsset bytes, directly from memory (from the TextAsset.bytes). Is that possible at all?
If there is no way around saving the bytes to the .asset before loading, then is that at least possible to save to persistentDataPath or somewhere else that will be supported in all platforms, and how to load AnimationClip from there then?
Also, taking the opportunity, why there is no way to delete an individual bundle from the Caching?
To Unity people: please try to give an answer to this, I’ve found many other threads with people mentioning that AnimationClip does not bundle correctly, and all them without a response.
Note: For this project I am stuck with 5.2.2, but I also tested on 5.6.1 and it has the same AnimationClip bundling bug…
Thanks.