public void Update()
    {
        if (_moviePlayer != null)
        {
            _volume = Mathf.Clamp01(_volume);
            if (_allowAudio)
            {
                if (_volume != _moviePlayer.Volume)
                {
                    _moviePlayer.Volume = _volume;
                }
                if (_audioBalance != _moviePlayer.AudioBalance)
                {
                    _moviePlayer.AudioBalance = _audioBalance;
                }
            }

            if (_loop != _moviePlayer.Loop)
            {
                _moviePlayer.Loop = _loop;
            }

            _moviePlayer.Update(false);

            // When the movie finishes playing, send a message so it can be handled
            if (!_moviePlayer.Loop && _moviePlayer.IsPlaying && _moviePlayer.IsFinishedPlaying)
            {
                _moviePlayer.Pause();
                this.SendMessage("MovieFinished", this, SendMessageOptions.DontRequireReceiver);
            }
        }
    }
 public void Update()
 {
     if (_moviePlayer != null)
     {
         _moviePlayer.Update(_forceUpdate);
     }
 }
Example #3
0
    public void OnRenderObject()
    {
        // We only want to draw once per frame
        if (Camera.current != Camera.main)
        {
            return;
        }

        if (_moviePlayer != null)
        {
            _moviePlayer.Update(false);
        }
    }
Example #4
0
    private void UpdateExtracting()
    {
        _movie.Update(false);
        if (_movie.DisplayFrame == _targetFrame)
        {
            if (_textureIndex < _textures.Length)
            {
                Texture2D texture = CopyRenderTexture((RenderTexture)_movie.OutputTexture);
                texture.Apply(false, false);
                _contents[_textureIndex]   = new GUIContent("Frame " + _targetFrame.ToString(), texture);
                _textures[_textureIndex++] = texture;
            }

            NextFrame();
        }
    }