AudioClip.length 长度

var length : float

Description描述

The length of the audio clip in seconds (Read Only)

以秒为单位,音频剪辑的长度。(只读)

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public IEnumerator Awake() {
		audio.Play();
		yield return new WaitForSeconds(audio.clip.length);
	}
}
audio.Play();
// Wait for the audio to have finished
//等待音频播放完成
yield WaitForSeconds (audio.clip.length);
Page last updated: 2011-1-13