Animation 动画

Inherits from Behaviour,IEnumerable

The animation component is used to play back animations.


You can assign animation clips to the animation component and control playback from your script. The animation system in Unity is weight based and supports: Animation Blending, Additive animations, Animation Mixing, Layers and full control over all aspects of animation playback.

可以指定动画剪辑到动画组件并从脚本控制动画播放。在Unity的动画系统基于权重并且支持动画融合,叠加动画,动画混合,标签和 完全控制动画播放的各个方面。

To play a simple animation use Animation.Play
To cross-fade between animations use Animation.CrossFade
To change how animations wrap (Loop, Once, PingPong) change the WrapMode of the respective AnimationClips in their import settings, or use AnimationState.wrapMode to change it at runtime.
AnimationState can be used to change the layer of an animation, modify playback speed, and for direct control over blending and mixing.


Animation also supports enumerators so you can loop through all AnimationStates like this:


using UnityEngine;

using System.Collections;

public class example : MonoBehaviour {

	public void Awake() {

		foreach (AnimationState state in animation) {

			state.speed = 0.5F;




// Make all animations in this character play at half speed

// 使这个角色的所有动画的播放速度降为一半

for (var state : AnimationState in animation) {

	state.speed = 0.5;




Inherited members继承成员

Inherited Variables继承变量

Inherited Functions继承函数