Jumat, 15 Mei 2015

Animation

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 playback.

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:

var anim: Animation;
function Start() {
anim = GetComponent.();
// Make all animations in this character play at half speed
for (var state : AnimationState in anim) {
state.speed = 0.5;
}
}