Esempio n. 1
0
 void StopCapture()
 {
     Debug.Log("Capture stop", this);
     if (capture_ != null)
     {
         capture_.EndCapture();
     }
     capture_ = null;
     Time.captureFramerate = 0;
 }
    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();
    }