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


C# MovieTexture类代码示例

本文整理汇总了C#中MovieTexture的典型用法代码示例。如果您正苦于以下问题:C# MovieTexture类的具体用法?C# MovieTexture怎么用?C# MovieTexture使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MovieTexture类属于命名空间,在下文中一共展示了MovieTexture类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Awake

 void Awake()
 {
     r = GetComponent<Renderer>();
     _movie = (MovieTexture)r.material.mainTexture;
     _audio = GetComponent<AudioSource>();
     _audio.clip = _movie.audioClip;
 }
开发者ID:Motts182,项目名称:VrGlobant,代码行数:7,代码来源:VideoPlay.cs

示例2: playTreasureAnimation

 public void playTreasureAnimation()
 {
     //show movie
     this.enabled = true;
     movie = this.GetComponent<RawImage>().mainTexture as MovieTexture;
     movie.Play();
 }
开发者ID:Rulfer,项目名称:Steam-Buccaneers,代码行数:7,代码来源:PlayVideoScript.cs

示例3: 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

示例4: Start

 // Use this for initialization
 void Start()
 {
     mtex = GetComponent<Renderer>().material.mainTexture as MovieTexture;
     #if (!UNITY_EDITOR)
         mtex.Play();
     #endif
 }
开发者ID:JoeyWelvaadt1999,项目名称:SplashScreen,代码行数:8,代码来源:PlayMovie.cs

示例5: Start

    /* ----------------------------------------
     * At Start, set up movie texture and audio clip,
     * playing the video if required.
     */
    void Start()
    {
        // Assign AudioSource component to 'audio' variable
        audio = GetComponent<AudioSource> ();

        if (!video)
            // IF there is no Movie Texure assigned to 'video', THEN use the Movie Texture assigned to the material's main texture
            video = GetComponent<Renderer>().material.mainTexture as MovieTexture;

        if (!audioClip)
            // IF there is no Audio Clip assigned to 'audioClip', THEN use the audio clip assigned to object's Audio Source component
            audioClip = audio.clip;

        video.Stop ();

        audio.Stop ();

        // Assign 'loop' boolean value to Movie Texture's 'Loop' option
        video.loop = loop;

        // Assign 'loop' boolean value to Audio Source 'Loop' option
        audio.loop = loop;

        if(playFromStart)
            // IF 'playFromStart' is selected, THEN call ControlMovie function
            ControlMovie();
    }
开发者ID:kdoore,项目名称:unity-5-cookbook-codes,代码行数:31,代码来源:PlayVideo.cs

示例6: Logic

 IEnumerator Logic(MovieTexture movie)
 {
     yield return new WaitForSeconds (movie.duration);
     //Application.LoadLevel(Application.loadedLevel+1);
     GameManager.instance.current_state = GameManager.GameStates.MAIN;
     GameManager.instance.scene_loaded = false;
 }
开发者ID:Higure27,项目名称:Grimoire,代码行数:7,代码来源:Video.cs

示例7: Start

    void Start()
    {
        r = GetComponent<Renderer>();
         movie = (MovieTexture)r.material.mainTexture;

         movie.Play();
    }
开发者ID:geordanex,项目名称:gamejam-unity,代码行数:7,代码来源:MenuController.cs

示例8: Start

	// Use this for initialization
	void Start () {
		resize_window_plane ();
		mov = (MovieTexture)renderer.material.mainTexture;
		mov.Play ();
		audio.Play();
		StartCoroutine(checkMovieEnds());
	}
开发者ID:charmjunewonder,项目名称:BVW-Round-2,代码行数:8,代码来源:HEStoryScript.cs

示例9: 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

示例10: Start

    // Use this for initialization
    void Start()
    {
        transform.localScale = new Vector3(Camera.main.orthographicSize/2 * (Screen.width/Screen.height),Camera.main.orthographicSize/2,1f);

        audioSource = GetComponent<AudioSource> ();

        if (HammerController.gameOverState == 1) {
            //success
            GetComponent<MeshRenderer> ().materials [0].mainTexture = textures [0];
            movTerxture = (MovieTexture)GetComponent<MeshRenderer> ().materials [0].mainTexture;
            movTerxture.Play();
            audioSource.clip = music1;
            audioSource.Play();
            audioSource.PlayOneShot(voiceovers[0]);

        }
        else if(HammerController.gameOverState == 2 )
        {
            GetComponent<MeshRenderer> ().materials [0].mainTexture = textures [1];
            movTerxture = (MovieTexture)GetComponent<MeshRenderer> ().materials [0].mainTexture;
            movTerxture.Play();
            audioSource.clip = music2;
            audioSource.Play();
            audioSource.PlayOneShot(voiceovers[1]);

        }
    }
开发者ID:ankit01217,项目名称:Float-Me-Up,代码行数:28,代码来源:EndController.cs

示例11: Awake

 void Awake()
 {
     myRenderer = GetComponent<Renderer>();
     myMovieTexture = (MovieTexture)myRenderer.material.mainTexture;
     myMovieTexture.loop = IsMovieLoopable;
     myMovieTexture.Play ();
 }
开发者ID:Mrbransky,项目名称:Kissy_Ghost,代码行数:7,代码来源:AnimaticPlayer.cs

示例12: Start

 // Use this for initialization
 void Start()
 {
     movie = GetComponent<Renderer>().material.mainTexture as MovieTexture;
     GetComponent<AudioSource>().clip = movie.audioClip;
     GetComponent<AudioSource>().Play();
     movie.Play();
 }
开发者ID:actuallymentor,项目名称:unity-tower-defense,代码行数:8,代码来源:IntroCutscene.cs

示例13: Start

 void Start()
 {
     StartCoroutine(showVideo());
     movie = (MovieTexture)renderer.material.mainTexture;
     audio = GetComponent<AudioSource>();
     audio.clip = movie.audioClip;
 }
开发者ID:victorffernandes,项目名称:SBGames_2003_FabieliHelena_NicoleAlves_VictorFernandes,代码行数:7,代码来源:VideoController.cs

示例14: playMovie

	public void playMovie(){
		if(!mov){
			resize_window_plane ();
			mov = (MovieTexture)renderer.material.mainTexture;
		}
		mov.Play ();
		audio.Play ();
	}
开发者ID:charmjunewonder,项目名称:BVW-Round-2,代码行数:8,代码来源:BEStoryScript.cs

示例15: Awake

 void Awake()
 {
     rend = GetComponent<Renderer>();
     mTexture = (MovieTexture)rend.material.mainTexture;
     videoDuration = mTexture.duration;
     audioSrc = GetComponent<AudioSource>();
     audioSrc.clip = mTexture.audioClip;
 }
开发者ID:gcoope,项目名称:HeroesAndVillains,代码行数:8,代码来源:AutoPlayMovie.cs


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