AnimationClip.length 动画长度
var length : float
Description描述
Animation length in seconds (Read Only)
动画的长度,以秒计算(只读)
C#
JavaScript
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);