AudioClip.isReadyToPlay 是否准备好播放

var isReadyToPlay : bool

Description描述

Is a streamed audio clip ready to play? (Read Only)

流式的音频剪辑已经准备好播放么?(只读)

If the AudioClip is downloading from a web site, this returns if enough data has been downloaded so playback should be able to start without interruptions. For AudioClips not associated with a web stream, this value always returns true.

如果音频剪辑是从网站上下载,此变量用来判断下载到的数据是否足够不间断的播放。对于不是来自web流的音频剪辑,这个值总是返回true。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void Start() {
		WWW www = new WWW("www.example.com");
		audio.clip = www.audioClip;
	}
	void Update() {
		if (!audio.isPlaying && audio.clip.isReadyToPlay)
			audio.Play();

	}
}
function Start () {
	var www : WWW = new WWW("www.example.com");
	audio.clip = www.audioClip;
}

function Update () {
	if(!audio.isPlaying && audio.clip.isReadyToPlay)
	audio.Play();
} 
Page last updated: 2011-1-13