zoukankan      html  css  js  c++  java
  • U3D PlayMovie

    using UnityEngine;
    using System.Collections;

    public class PlayMovie : MonoBehaviour {
        
        // Use this for initialization
        public MovieTexture movTexture;
        private bool playonce = false;
        void Start() {
            renderer.material.mainTexture = movTexture;
            
            //movTexture.Play();
        }
        
        // Update is called once per frame
        void Update ()
        {

        }
        
        void OnMouseDown()
        {
            playonce = !playonce;
            if(playonce == false)
            {
                movTexture.Stop();
            }
        }
        
        void OnGUI()
        {
            if(playonce)
            {
                print("Play video");
                GUI.DrawTexture(new Rect(0,0,Screen.width,Screen.height),movTexture,ScaleMode.ScaleToFit);
                movTexture.Play();
            }
        }
        
    }

  • 相关阅读:
    TOYS POJ
    口罩发放
    Qin Shi Huang's National Road System HDU
    次小生成树
    ACM Contest and Blackout UVA
    Strongly connected HDU
    tarjan
    Network HDU
    【洛谷 1351】联合权值
    【洛谷 3884】二叉树问题
  • 原文地址:https://www.cnblogs.com/JimmyCode/p/2529421.html
Copyright © 2011-2022 走看看