AnimationState.time 时间


var time : float

Description描述

The current time of the animation

动画当前时间

If the time is larger than length it will be   wrapped according to wrapMode. The value can be larger than the animations   length. In this case playback mode will remap the time before sampling. This   value usually goes from 0 to infinity

如果时间大于长度它将按照wrapWode循环.该值可以大于动画的长度.在这种情况下回放模式将在采样前重映射时间.这个值通常从0到无穷.

  • C#

  • JavaScript

using UnityEngine;using System.Collections;public class example : MonoBehaviour {public void Awake() {animation["Walk"].time = 0.0F;}}
// Rewind the walk animation// 将walk动画置为初始animation["Walk"].time = 0.0;


,