当前位置: 首页>>代码示例>>C#>>正文


C# MovieTexture.Stop方法代码示例

本文整理汇总了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;
        }
    }
开发者ID:ludo6577,项目名称:NumericWall,代码行数:33,代码来源:DraggableVideoObject.cs

示例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);
	}
开发者ID:eledezma,项目名称:CodeEscape,代码行数:32,代码来源:Level10Video.cs

示例3: playVideo

 public void playVideo(MovieTexture texture)
 {
     this.movie = texture;
     this.gameObject.SetActive(true);
     GetComponent<RawImage>().texture = movie as MovieTexture;
     movie.Stop();
     movie.Play();
 }
开发者ID:RotaruDan,项目名称:firstaidgame,代码行数:8,代码来源:PlayVideo.cs

示例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 ();
    }
开发者ID:Compound-B,项目名称:Mars_6Y_Stereoscopic,代码行数:11,代码来源:Collision_PopUp2.cs

示例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();
		}

	}
开发者ID:GroupByStudios,项目名称:TDS_Gauss,代码行数:16,代码来源:VideoPlayer.cs

示例6: StopMovie

	/// <summary>
	/// Stop playing custom MovieTexture.
	/// </summary>
	/// <param name='mt'>
	/// MovieTexture.
	/// </param>
	public static void StopMovie(MovieTexture mt) 
	{
		if (mt != null) mt.Stop();
	}
开发者ID:Higure27,项目名称:Grimoire,代码行数:10,代码来源:PlayMovieTexture.cs

示例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;
    }
开发者ID:xnguyena2,项目名称:building_brizolar,代码行数:55,代码来源:ControlEvent.cs

示例8: Start

 void Start()
 {
     movieFile = ((MovieTexture)GetComponent<Renderer> ().material.mainTexture);
     movieFile.Stop ();
 }
开发者ID:Compound-B,项目名称:Mars_6Y_Stereoscopic,代码行数:5,代码来源:videoPlayTrigger.cs

示例9: OnClick

	void OnClick(){
		Debug.Log ("OnClick");
		movieTexture = renderer.material.mainTexture as MovieTexture;
		movieTexture.Stop();
		movieTexture.Play();
	}
开发者ID:QiushiZhu,项目名称:lol-database,代码行数:6,代码来源:PlayMovie.cs


注:本文中的MovieTexture.Stop方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。