"Unity3d Study----Wheat Academy"----------unity3d common components and analysis----------Animator Animation state machine

Source: Internet
Author: User

Animator is a new animation after the Unity 4 release

You can edit the transformations of the line animations directly in the editor, or you can use the code to call the underlying directly to convert the animation

Code:

1 usingUnityengine;2 usingSystem.Collections;3 4  Public classAnimationtest:monobehaviour {5 6     //Animation Animation;7 Animator Animator;8 9     //Use this for initializationTen     voidStart () { One      A         //animation = getcomponent<animation> (); //Get animation Components -Animator = getcomponent<animator> (); -     } the      -     //Update is called once per frame -     voidUpdate () { -      +         //Animation. Play ("Walk"); //play animation, animated name -  +         //Parameters: Animation name, interval (the transition time between the current animation and the specified animation, the next animation is executed as 0, and the specified animation is executed after the current animation is finished) A         //layer (the layer that is currently located), atAnimator. Crossfade ("Walk",0, -1,0);//call the underlying to play the animation without using the line in Unity's animator editor -  -     } -}

Using Unity direct editing animations to convert unity version is 4.7.2f

"Unity3d Study----Wheat Academy"----------unity3d common components and analysis----------Animator Animation state machine

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.