Play() public method

public Play ( ) : void
return void
コード例 #1
0
ファイル: Video.cs プロジェクト: leon196/WJ
        void Start()
        {
            materialEffect = GetComponent<Renderer>().material;

            var url = "file://" + Application.dataPath + "/StreamingAssets/Back To The Futur.ogg";

            var www = new WWW(url);

            movieTexture = (MovieTexture)www.movie;
            movieTexture.loop = true;
            movieTexture.Play();

            UnityEngine.Shader.SetGlobalTexture("_SamplerVideo", movieTexture);
        }
コード例 #2
0
        public void SetTexture2D(MovieTexture tex)
        {
            this.oggTexture = tex;

            renderer.material.SetTexture("_MainTex", tex);

            // In order to get texture size, we have to play the texture for one frame.
            // this is a known bug in unity.
            // http://forum.unity3d.com/threads/71220-get-MovieTexture-resolution
            tex.Play();
            tex.Pause();
            tex.loop = this.isLooping;
            this.textureAspectRatio = (float)tex.width / tex.height;
        }
コード例 #3
0
 // Use this for initialization
 void Start()
 {
     movieTexture = mat.mainTexture as MovieTexture;
     movieTexture.loop = true;
     movieTexture.Play();
 }