Beispiel #1
0
 void RunCapture()
 {
     Debug.Log("Capturing headbox samples...", this);
     capture_.CaptureAllHeadboxSamples();
     if (capture_.IsCaptureComplete())
     {
         StopCapture();
     }
 }
    public void Update()
    {
        if (capture_status_ != null && capture_status_.TaskContinuing() && !UpdateAndCheckUiTimerReady())
        {
            return;
        }

        // Refresh the Editor GUI to finish the task.
        EditorUtility.SetDirty(capture_notification_component_);

        if (bake_stage_ == BakeStage.kCapture)
        {
            --capture_timer_;
            if (capture_timer_ == 0)
            {
                capture_timer_ = kTimerExpirationsPerCapture;

                monitored_capture_.RunCapture();

                if (monitored_capture_.IsCaptureComplete() &&
                    capture_status_.TaskContinuing())
                {
                    monitored_capture_.EndCapture();
                    monitored_capture_ = null;

                    bake_stage_ = BakeStage.kWaitForDoneButton;
                }
            }

            if (capture_status_ != null && !capture_status_.TaskContinuing())
            {
                bake_stage_ = BakeStage.kComplete;
                if (monitored_capture_ != null)
                {
                    monitored_capture_.EndCapture();
                    monitored_capture_ = null;
                }
            }
        }

        // Repaint with updated progress the GUI on each wall-clock time tick.
        Repaint();
    }