本文整理汇总了C#中MovieTexture.Stop方法的典型用法代码示例。如果您正苦于以下问题:C# MovieTexture.Stop方法的具体用法?C# MovieTexture.Stop怎么用?C# MovieTexture.Stop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MovieTexture
的用法示例。
在下文中一共展示了MovieTexture.Stop方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoSetVideo
IEnumerator DoSetVideo(MovieTexture texture)
{
//We need the video to play before we can get his size
while (!texture.isPlaying)
{
texture.Play();
yield return null;
}
texture.Stop();
movie = texture;
movie.loop = true;
var videoObject = GetComponentInChildren<VideoObject>();
videoObject.SetVideo(texture);
playButton = GetComponentInChildren<Image>();
var collider = GetComponent<BoxCollider2D>();
var ratioX = (float)texture.width / texture.height;
var ratioY = (float)texture.height / texture.width;
if (ratioX > 1)
{
var size = new Vector2(RectTransform.sizeDelta.x * ratioX, RectTransform.sizeDelta.y);
RectTransform.sizeDelta = size;
collider.size = size;
}
else
{
var size = new Vector2(RectTransform.sizeDelta.x, RectTransform.sizeDelta.y * ratioY);
RectTransform.sizeDelta = size;
collider.size = size;
}
}
示例2: PlayVideo
public IEnumerator PlayVideo()
{
GameObject.Find ("First Person Controller").GetComponent<Level10Health> ().guiEnabled = false;
cam.depth = 2;
GameObject.Find("Initialization").GetComponent<AudioSource>().audio.Stop();
GameObject.Find("Initialization").GetComponent<CursorTime>().showCursor = false;
GameObject.Find("Initialization").GetComponent<AudioSource>().volume = 1;
Screen.lockCursor = true;
//Screen.showCursor = false;
//GameObject.Find("Main Camera").GetComponent<MouseLook>().enabled = false;
//GameObject.Find("First Person Controller").GetComponent<MouseLook>().enabled = false;
movie = renderer.material.mainTexture as MovieTexture;
audio.clip = movie.audioClip;
audio.Play();
movie.Play();
yield return new WaitForSeconds(audio.clip.length);
movie.Stop();
cam.depth = -2;
audio.volume = 0;
movie.Play();
audio.Play();
yield return new WaitForSeconds(0.2F);
movie.Pause();
audio.Pause();
Screen.lockCursor = false;
GameObject.Find("Initialization").GetComponent<AudioSource>().audio.clip = scary;
audio.volume = 1;
GameObject.Find("Initialization").GetComponent<AudioSource>().audio.Play ();
GameObject.Find("Initialization").GetComponent<CursorTime>().showCursor = true;
GameObject.Find ("First Person Controller").GetComponent<Level10Health> ().guiEnabled = true;
//Application.LoadLevel(Application.loadedLevel);
}
示例3: playVideo
public void playVideo(MovieTexture texture)
{
this.movie = texture;
this.gameObject.SetActive(true);
GetComponent<RawImage>().texture = movie as MovieTexture;
movie.Stop();
movie.Play();
}
示例4: Start
void Start()
{
movieFile = ((MovieTexture)GetComponent<Renderer> ().material.mainTexture);
if(movieFile != null)
movieFile.Stop ();
if(musicFile == null)
musicFile = GetComponent<AudioSource> ();
if(musicFile != null)
musicFile.Stop ();
}
示例5: Start
// Use this for initialization
void Start () {
movie = GetComponent<RawImage>().mainTexture as MovieTexture;
audioSource = GetComponent<AudioSource>();
if (movie != null && audioSource != null)
{
audioSource.Stop();
movie.Stop();
audioSource.Play();
movie.Play();
}
}
示例6: StopMovie
/// <summary>
/// Stop playing custom MovieTexture.
/// </summary>
/// <param name='mt'>
/// MovieTexture.
/// </param>
public static void StopMovie(MovieTexture mt)
{
if (mt != null) mt.Stop();
}
示例7: loadcrosel
private IEnumerator loadcrosel()
{
firstLoadCarousel = false;
if (infomationCarousel [currentCarousel] != "") {
carouselTimer.Stop();
string[] infos = infomationCarousel [currentCarousel].Split (new string[]{" "}, System.StringSplitOptions.None);
string filename = infos [0];
timeDisplay = int.Parse (infos [1]);
//Debug.Log(filename+timeDisplay);
if (timeDisplay > 0) {
haveVdieonow = false;
var url = IP + "crs/"+filename;
Texture imageTexture = null;
if(!dicImageCarousel.ContainsKey(url)){
WWW imageURLWWW = new WWW (url);
yield return imageURLWWW;
if (imageURLWWW.texture != null) {
imageTexture = (Texture)imageURLWWW.texture;
}
dicImageCarousel.Add(url,imageTexture);
}else {
imageTexture = dicImageCarousel[url];
}
Videocarosel.texture = imageTexture;
carouselTimer.Interval = timeDisplay*1000;
carouselTimer.Start();
}else {
var url = IP + "crs/"+filename;
if(!dicMovieCarousel.ContainsKey(url)){
WWW www = new WWW(url);
movieTextureCarousel = www.movie;
while (!movieTextureCarousel.isReadyToPlay) {
yield return null;
}
dicMovieCarousel.Add(url,movieTextureCarousel);
}else {
movieTextureCarousel = dicMovieCarousel[url];
movieTextureCarousel.Stop();
}
movieTextureCarousel.loop = false;
Videocarosel.texture = movieTextureCarousel;
movieTextureCarousel.Play();
haveVdieonow = true;
}
}
currentCarousel++;
currentCarousel = currentCarousel%infomationCarousel.Length;
yield return null;
}
示例8: Start
void Start()
{
movieFile = ((MovieTexture)GetComponent<Renderer> ().material.mainTexture);
movieFile.Stop ();
}
示例9: OnClick
void OnClick(){
Debug.Log ("OnClick");
movieTexture = renderer.material.mainTexture as MovieTexture;
movieTexture.Stop();
movieTexture.Play();
}