Animation 动画

Inherits from Behaviour,IEnumerable

The animation component is used to play back animations.

animation组件用于播放动画。

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.Play;
如果想在动画之间交叉淡入,可以使用Animation.CrossFade;
如果想改变动画模式(循环,一次,乒乓),可以改变动画导入设置里面的动画帧的WrapMode,或者在运行时改变AnimationState.wrapMode的值;
AnimationState可以用于改变动画的层,修改播放速度,并且直接控制融合与混合。

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

动画也支持枚举,所以你可以像这样在AnimationStates之间循环:

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;
}

Variables变量

Functions函数

Inherited members继承成员

Inherited Variables继承变量

Inherited Functions继承函数

Inherited Class Functions继承类函数

最后修改:2011年10月17日 Monday 16:42

本脚本参考基于Unity 3.4.1f5

英文部分版权属©Unity公司所有,中文部分© Unity圣典 版权所有,未经许可,严禁转载 。