AnimationClip.length 动画长度

var length : float

Description描述

Animation length in seconds (Read Only)

动画的长度,以秒计算(只读)

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public IEnumerator Awake() {
		animation.Play();
		yield return new WaitForSeconds(animation.clip.length);
	}
}
animation.Play();
// 等待动画完成
yield WaitForSeconds (animation.clip.length);
Page last updated: 2011-9-16