MovieTexture.Stop 停止

function Stop () : void

Description描述

Stops playing the movie, and rewinds it to the beginning.

停止播放影片,并后退到开始处。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public MovieTexture movTexture;
	void Start() {
		renderer.material.mainTexture = movTexture;
		movTexture.Play();
	}
	void Update() {
		if (Input.GetKeyDown(KeyCode.Space))
			movTexture.Stop();

	}
}
// Assigns a movie texture to the current transform, plays it
// and when the user presses the *space* key, stops the video.
//指定一个MovieTexture到当前的变换,播放它,并当用户按下空格键,停止播放
var movTexture : MovieTexture;

function Start () {
	renderer.material.mainTexture = movTexture;
	movTexture.Play();
}

function Update() {
	if(Input.GetKeyDown(KeyCode.Space))
		movTexture.Stop();
}
Page last updated: 2011-3-18