Unity3d usage Experience (2): Unity3d dynamic Download Animation resources--animationclip Use-smart Qi

Source: Internet
Author: User

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 when I download the Animation skeleton animation dynamically. There are hundreds of animation resources in our project, each set of animation about 300KB to 900KB before, 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 is running, the downloaded Animation component is assigned to the corresponding Gameobject Animation variable. The tragedy was that I found Animation accessors to be read-only at this time.

the right approach:

All Animationclip objects in the export Animation are added as arrays to ScriptObject, saved as asset files, and exported as assetbundle files. When the game is running, add the downloaded clip object to the animation component to complete the animated dynamic loading.

The animationclip contains the animated data and can be flexibly added to the delete from the animation.

Another seemingly viable approach:

   the Prefab-instantiated game object that the FBX is poured into,--skinnedmeshrenderer the mesh (grid data) in the component, and Texture in Shader, respectively, into Assetbun Dle, the remaining gameobject of the two data will be deleted together with the animation into a prefab, the dynamic assembly when running. If the way in which the role resources are dynamically downloaded in the project is this way, you can somewhat circumvent the problems encountered in the previous article. However, the former solution is a solution to the problem in a more accurate way.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.