MovieTexture.Play 播放

function Play () : void

Description描述

Starts playing the movie.

开始播放影片。

Note that a running MovieTexture will use a lot of CPU power, and it will continue running until it is manually stopped or a new level is loaded.

注意运行MovieTexture将使用大量的CPU资源,并且它将持续运行直到它被手动停止或加载新的关卡。

Also note that MovieTextures does not behave exactly the same as for example audio clips. When you call the Play() method on a MovieTexture, it is the Asset that will start playing, and not a particular instance of the movie. This means that if you have for example several planes in your scene, all having the same MovieTexture set as their materials texture, when you call Play() on one of them, every instance of the Movie will start playing.

并注意,MovieTextures是不完全相同的行为,例如音频剪辑。当在一个MovieTextures上调用Play()方法,资源将被播放,而不是电影的特定实例。这意味着如果在你的场景中实例几个飞机,所有相同MovieTexture设置为他们的材质纹理,当你在他们中的一个上调用Play(),影片的每一个实例将开始播放。

参见:Stop

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public MovieTexture movTexture;
	void Start() {
		renderer.material.mainTexture = movTexture;
		movTexture.Play();
	}
}
// Assigns a movie texture to the current material and plays it.
//指定一个影片纹理到当前的材质,并播放

var movTexture : MovieTexture;

function Start () {
renderer.material.mainTexture = movTexture;
movTexture.Play();
}
最后修改:2011年3月18日 Friday 11:12

本脚本参考基于Unity 3.4.1f5

英文部分版权属©Unity公司所有,中文部分© Unity圣典 版权所有,未经许可,严禁转载 。