void Update()
 {
     if (m_rt == null)
     {
         var buf = m_recorder.GetScratchBuffer();
         if (buf != null)
         {
             m_rt          = new RenderTexture(buf.width, buf.height, 0, RenderTextureFormat.ARGB32);
             m_rt.wrapMode = TextureWrapMode.Repeat;
             m_rt.Create();
         }
     }
     if (m_updatePreview)
     {
         m_updatePreview = false;
         m_recorder.GetFrameData(m_rt, m_currentFrame);
         UpdatePreviewImage(m_rt);
     }
     if (m_updateStatus || record)
     {
         m_updateStatus = false;
         int recoded_frames = m_recorder.GetFrameCount();
         m_timeSlider.maxValue = recoded_frames;
         int begin_frame = m_beginFrame;
         int end_frame   = m_endFrame == -1 ? recoded_frames : m_endFrame;
         int frame_count = end_frame - begin_frame;
         m_textInfo.text =
             recoded_frames.ToString() + " recoded frames\n" +
             frame_count.ToString() + " output frames (" + begin_frame + " - " + end_frame + ")\n" +
             "expected file size: " + m_recorder.GetExpectedFileSize(begin_frame, end_frame);
     }
 }
 void Update()
 {
     if (m_updateStatus || record)
     {
         m_updateStatus = false;
         int recoded_frames = m_recorder.GetFrameCount();
         m_textInfo.text = recoded_frames.ToString() + " recoded frames";
     }
 }