示例#1
0
        private MovieTexture LoadFromResources(string uri)
        {
            string videoname = uri;

            string[] splitted = videoname.Split('.');
            string   fullname = splitted[0];

            for (int i = 1; i < splitted.Length - 1; i++)
            {
                fullname += "." + splitted[i];
            }

            fullname = Game.Instance.getGameName() + "/" + fullname;
            Movie    = Resources.Load(fullname) as MovieTexture;

            if (Movie == null)
            {
                loaded = false;
                Debug.Log("No se pudo cargar: " + this.path);
            }
            else
            {
                loaded = true;
            }

            return(Movie);
        }
 // Use this for initialization
 void Start()
 {
     webGLMovieTexture = new WebGLMovieTexture("StreamingAssets/Chrome_ImF.mp4");
     cube.GetComponent<MeshRenderer>().material = new Material(Shader.Find("Diffuse"));
     cube.GetComponent<MeshRenderer>().material.mainTexture = webGLMovieTexture;
     webGLMovieTexture.Play();
 }
示例#3
0
 void Start()
 {
     tex = new WebGLMovieTexture("StreamingAssets/Chrome_ImF.mp4");
     cube = GameObject.CreatePrimitive (PrimitiveType.Cube);
     cube.transform.localScale *= 4;
     cube.GetComponent<Renderer>().material = new Material (Shader.Find("Diffuse"));
     cube.GetComponent<Renderer>().material.mainTexture = tex;
 }
示例#4
0
 void Start()
 {
     tex  = new WebGLMovieTexture("StreamingAssets/Chrome_ImF.mp4");
     cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
     cube.transform.localScale *= 4;
     cube.GetComponent <Renderer>().material             = new Material(Shader.Find("Diffuse"));
     cube.GetComponent <Renderer>().material.mainTexture = tex;
 }
示例#5
0
    void Start()
    {
        tex = new WebGLMovieTexture(moviePath);
        gameObject.GetComponent<Renderer>().material.mainTexture = tex;

        tex.loop = true;
        isPLaying = false;
    }
示例#6
0
文件: TV.cs 项目: Elringus/HajiJam
    private void Start()
    {
        CommMovie = new WebGLMovieTexture("StreamingAssets/vid_Comm.ogg");

        GetComponent <Renderer>().materials[1].mainTexture = CommMovie;
        CommMovie.Play();
        //      ((MovieTexture)GetComponent<Renderer>().materials[1].mainTexture).loop = true;
        //((MovieTexture)GetComponent<Renderer>().materials[1].mainTexture).Play();
    }
        public WebGLStreamingVideoPlugin(string url, GameObject gameObject)
        {
            Url     = "StreamingAssets/" + url;
            _status = StreamingVideoStatus.Unknown;

            m_gameObject = gameObject;
            MeshRenderer meshRenderer = m_gameObject.GetComponent <MeshRenderer>();

            if (meshRenderer)
            {
                m_movieTexture = new WebGLMovieTexture(Url);
                meshRenderer.material.mainTexture = m_movieTexture.GetVideoTexture();
            }
        }
 public void OnPlayVideo()
 {
             #if UNITY_WEBGL //&& !UNITY_EDITOR
     tex = new WebGLMovieTexture("StreamingAssets/EasyMovieTexture.mp4");
     videoPlaySurface.GetComponent <MeshRenderer>().material             = new Material(Shader.Find("Diffuse"));
     videoPlaySurface.GetComponent <MeshRenderer>().material.mainTexture = tex;
     tex.Play();
     tex.loop = true;
             #elif !UNITY_WEBGL
     Debug.LogError("Play Video");
     mediaPlayerCtrl.Play();
     mediaPlayerCtrl.m_bAutoPlay = true;
             #endif
 }
示例#9
0
        private IEnumerator LoadFromSystem(string uri)
        {
            string url_prefix = "file:///";
            string videoname  = uri;

            string[] splitted = videoname.Split('.');
            string   dir = "", fullname = splitted[0];

            for (int i = 1; i < splitted.Length - 1; i++)
            {
                fullname += "." + splitted[i];
            }

            if (System.IO.File.Exists(Game.Instance.getSelectedGame() + fullname + ".ogv"))
            {
                dir = url_prefix + Game.Instance.getSelectedGame() + fullname + ".ogv";
            }
            else
            {
                dir = url_prefix + Game.Instance.getSelectedGame() + videoname;
            }

            Debug.Log(dir);

            WWW www = new WWW(dir);

            yield return(www);

            if (www.error != null)
            {
                Debug.Log("Error: Can't laod movie! - " + www.error);
                yield break;
            }
            else
            {
                MovieTexture video = www.movie as MovieTexture;
                Debug.Log("Movie loaded");
                Debug.Log(www.movie);
                loaded = true;
                Movie  = video;
            }
        }
示例#10
0
        // #####################################################
        // ################## LOADING METHODS ##################
        // #####################################################

#if UNITY_WEBPLAYER || UNITY_WEBGL
        private WebGLMovieTexture LoadFromWebGL(string uri)
        {
            string videoname = uri;

            string[] splitted = videoname.Split('/');

            splitted = splitted[splitted.Length - 1].Split('.');
            string fullname = splitted[0];

            for (int i = 1; i < splitted.Length - 1; i++)
            {
                fullname += "." + splitted[i];
            }

            fullname = "StreamingAssets/" + fullname + ".ogv";

            Debug.Log(fullname);

            Movie  = new WebGLMovieTexture(fullname);
            loaded = true;

            return(Movie);
        }
 public WebGLStreamingVideoPlugin(string url)
 {
     Url = url;
     _movieTexture = new WebGLMovieTexture(url);
     _status = StreamingVideoStatus.Unknown;
 }
示例#12
0
 public WebGLStreamingVideoPlugin(string url)
 {
     Url           = url;
     _movieTexture = new WebGLMovieTexture(url);
     _status       = StreamingVideoStatus.Unknown;
 }
示例#13
0
 void Awake()
 {
     tex2 = new WebGLMovieTexture(videoPath2);
     gameObject.GetComponent <MeshRenderer>().material.mainTexture = tex2;
 }
示例#14
0
 void Awake()
 {
     tex = new WebGLMovieTexture("StreamingAssets/Chrome_ImF.mp4");
     cube.GetComponent <MeshRenderer>().material             = new Material(Shader.Find("Diffuse"));
     cube.GetComponent <MeshRenderer>().material.mainTexture = tex;
 }
示例#15
0
 void Start()
 {
     tex = new WebGLMovieTexture("StreamingAssets/EasyMovieTexture.mp4");
     cube.GetComponent <MeshRenderer>().material             = new Material(Shader.Find("Diffuse"));
     cube.GetComponent <MeshRenderer>().material.mainTexture = tex;
 }
 public void Awake()
 {
     visualiser = new WebGLMovieTexture(videoPath);
     gameObject.GetComponent <MeshRenderer>().material.mainTexture = visualiser;
 }