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

Source: Internet
Author: User


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

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.