Introduction:
In the use of unity3d development of micro-end, or web games often need to package resources into Assetbundle, and then through the way of the WWW dynamic download resources. What I want to share today is a few detours and my final solution to the dynamic download of Animation skeletal animation.
There are hundreds of animation resources in our project, each set of animations around 300KB to 900KB, so there is a very important requirement is the dynamic download required animation.
The wrong way:
The first way I saw the demand was to instantiate the Prefab that the FBX was poured into, save the Animation through ScriptObject as a asset file, and then export it to a assetbundle file.
When the game executes, the downloaded Animation component is assigned to the corresponding Gameobject Animation variable.
The tragedy is that I only found out at this time that the Animation accessor was read-only.
The right approach:
All Animationclip objects in the export Animation are added to the scriptobject as arrays, saved as asset files, and exported as assetbundle files. When the game executes, the downloaded Clip object is added to the animation component where the animated dynamic loading is completed.
The animationclip includes animated data that can be flexibly removed from the animation.
There is also a plausible way to do this:
The Prefab instantiated game object that the FBX is poured into. The data in the--skinnedmeshrenderer component (mesh data) and the Shader in the Texture are exported to assetbundle respectively in the larger space. The remaining gameobject of the two data will be deleted together with the animation to make a prefab. Dynamic assembly at the time of execution.
Assume that the way in which a role resource is dynamically downloaded in a project is in such a way. The problem that can be met in some degree by bypassing the previous article. But the former solution is a more accurate solution to the problem.
(turn) Unity3d usage experience (2): Unity3d dynamic Download Animation resources--animationclip Use-smart Qi