void Start() { CTI = new Rect(0, 0, 0, 0); style.fontSize = timecodeSize; style.normal.textColor = Color.white; if (playMode == UVT_PlayMode.PingPong && pingpongStartsWithReverse) { //loopNumber--; index = lastFrame; playDirection = UVT_PlayDirection.backward; } else { index = firstFrame; } if (audioAttached) { myAudio.attachedAudioSource = GetComponent <AudioSource>(); myAudio.fps = FPS; myAudio.frameIndex = firstFrame; } playState = UVT_PlayState.Paused; if (autoPlay) { Play(); } }
// Pauses the video texture public void Stop() { if (playState != UVT_PlayState.Paused) { if (enableAudio) myAudio.Stop(); playState = UVT_PlayState.Paused; UpdatePlayFactor(); } }
// Plays the video texture public void Play() { if (enableAudio) { myAudio.frameIndex = index; myAudio.Sync(); myAudio.UnMute(); myAudio.Play(); } playState = UVT_PlayState.Playing; UpdatePlayFactor(); }
// Plays the video texture public void Play() { enableGUI = true; if (enableAudio && playDirection == UVT_PlayDirection.forward) { myAudio.frameIndex = index; myAudio.Sync(); myAudio.UnMute(); myAudio.Play(); } playState = UVT_PlayState.Playing; UpdatePlayFactor(); }
// Pauses the video texture public void Stop() { if (playState != UVT_PlayState.Paused) { if (enableAudio) { myAudio.Stop(); } playState = UVT_PlayState.Paused; UpdatePlayFactor(); } if (autoHideWhenDone) { enableGUI = false; } }
void Start () { // Enables / Disables controls if (enableControls) { scrollBar.gameObject.active = true; CTI.gameObject.active = true; timeCode.gameObject.active = true; HandleControls(); scrollBarLength = scrollBar.GetComponent<MeshFilter>().mesh.bounds.extents.x; timeCode.GetComponent<Renderer>().sharedMaterial.shader = Shader.Find("GUI/3D Text Depth Aware Shader"); } else { if (scrollBar != null) scrollBar.gameObject.active = false; if (CTI != null) CTI.gameObject.active = false; if (timeCode != null) timeCode.gameObject.active = false; } if (playMode == UVT_PlayMode .PingPong && pingpongStartsWithReverse) { currentLoop--; index = lastFrame; playDirection = UVT_PlayDirection.backward; } else index = firstFrame; // Sets up audio for playback if (audioAttached) { myAudio.attachedAudioSource = GetComponent<AudioSource>(); myAudio.fps = FPS; myAudio.frameIndex = firstFrame; } // Assigns the layer to the chosen channel switch (textureType) { case TextureType.Diffuse: texType = "_MainTex"; break; case TextureType.NormalMap: texType = "_BumpMap"; break; case TextureType.DetailMap: texType = "_Detail"; break; case TextureType.Illumination: texType = "_Illum"; break; case TextureType.HeightMap: texType = "_ParallaxMap"; break; } playState = UVT_PlayState.Paused; if (autoPlay) Play(); }
void Start () { CTI = new Rect(0,0,0,0); style.fontSize = timecodeSize; style.normal.textColor = Color.white; if (playMode == UVT_PlayMode.PingPong && pingpongStartsWithReverse) { //loopNumber--; index = lastFrame; playDirection = UVT_PlayDirection.backward; } else index = firstFrame; if (audioAttached) { myAudio.attachedAudioSource = GetComponent<AudioSource>(); myAudio.fps = FPS; myAudio.frameIndex = firstFrame; } playState = UVT_PlayState.Paused; if (autoPlay) Play(); }
// Pauses the video texture public void Stop() { if (playState != UVT_PlayState.Paused) { if (enableAudio) myAudio.Stop(); playState = UVT_PlayState.Paused; UpdatePlayFactor(); } if (autoHideWhenDone){ enableGUI = false; } }
// Plays the video texture public void Play() { enableGUI = true; if (enableAudio && playDirection == UVT_PlayDirection.forward) { myAudio.frameIndex = index; myAudio.Sync(); myAudio.UnMute(); myAudio.Play(); } playState = UVT_PlayState.Playing; UpdatePlayFactor(); }