void OnGUI() { if (_mto == null) { return; } int bw = Screen.width / 3; int bh = bw / 2; int by = Screen.height - bh; bool isPlaying = _mto.IsPlaying(); if (GUI.Button(new Rect(0, by, bw, bh), isPlaying? "Pause" : "Play")) { if (isPlaying) { _mto.Pause(); } else { _mto.Play(); } } else if (GUI.Button(new Rect(bw, by, bw, bh), "Rewind")) { _mto.Rewind(); } }
void Start() { if (targetTexture != null) { mto = ScriptableObject.CreateInstance <GLMovieTextureObject>(); if (!mto.Load(targetTexture, targetTexture.name)) { Destroy(mto); mto = null; return; } mto.SetLoop(loop); if (autoPlay) { mto.Play(); } return; } targetTexture = new Texture2D(1, 1); }
void SetMovieFile(string movieFileName) { if( mto!=null ){ Destroy(mto); mto = null; } mto = ScriptableObject.CreateInstance<GLMovieTextureObject>(); mto.Load(targetTexture,movieFileName); mto.SetLoop(loop); if( autoPlay ){ mto.Play(); } }
void SetMovieFile(string movieFileName) { if (mto != null) { Destroy(mto); mto = null; } mto = ScriptableObject.CreateInstance <GLMovieTextureObject>(); mto.Load(targetTexture, movieFileName); mto.SetLoop(loop); if (autoPlay) { mto.Play(); } }
void LoadMovieTexture(string moviePath) { if( _renderer==null || moviePath == null ){ return; } if( _mto != null ){ Destroy(_mto); _mto = null; } // Create an empty texture for MovieTexture Texture2D texture = new Texture2D(1,1,TextureFormat.ARGB32, false); _mto = ScriptableObject.CreateInstance<GLMovieTextureObject>(); _mto.Load(texture,moviePath); _mto.SetLoop(true); _mto.Play(); _renderer.material.mainTexture = texture; }
void LoadMovieTexture(string moviePath) { if( _rawImage == null || moviePath == null ){ return; } if( _mto != null ){ Destroy(_mto); _mto = null; } Texture2D texture = new Texture2D(1,1,TextureFormat.ARGB32, false); _mto = ScriptableObject.CreateInstance<GLMovieTextureObject>(); _mto.Load(texture, moviePath); _mto.SetLoop(true); _mto.Play(); _rawImage.texture = texture; }
void LoadMovieTexture(string moviePath) { if (_renderer == null || moviePath == null) { return; } if (_mto != null) { Destroy(_mto); _mto = null; } // Create an empty texture for MovieTexture Texture2D texture = new Texture2D(1, 1, TextureFormat.ARGB32, false); _mto = ScriptableObject.CreateInstance <GLMovieTextureObject>(); _mto.Load(texture, moviePath); _mto.SetLoop(true); _mto.Play(); _renderer.material.mainTexture = texture; }