Commit ffe9e582 authored by ATREVI Dieudonne's avatar ATREVI Dieudonne
Browse files

Merge branch 'dev' of https://gitlab.inria.fr/OCSR/chaos into #24_real_menu

parents b3b50c69 9fb91fbe
......@@ -47,7 +47,7 @@ public class CamRecorder : MonoBehaviour
/// </summary>
protected virtual void Start()
{
StartCoroutine(RecordDataScreen());
}
/// <summary>
......@@ -77,28 +77,25 @@ public class CamRecorder : MonoBehaviour
/// <summary>
/// Create screenshot during recording time
/// </summary>
//protected virtual void LateUpdate()
private void OnGUI()
//private void OnPostRender()
IEnumerator RecordDataScreen()
{
if (runOncePerFrame)
// We should only read the screen buffer after rendering is complete
yield return new WaitForEndOfFrame();
if (record && !(Time.timeSinceLevelLoad < timeToStart))
{
Debug.Log(Time.fixedTime);
if (record && !(Time.timeSinceLevelLoad < timeToStart))
{
if (Time.captureFramerate == 0)
Time.captureFramerate = framerate;
if (Time.captureFramerate == 0)
Time.captureFramerate = framerate;
if (Time.timeSinceLevelLoad > timeToStop)
{
record = false;
Time.captureFramerate = 0;
Debug.Log("record stopped !");
Application.Quit();
return;
}
if (Time.timeScale == 0)
return;
if (Time.timeSinceLevelLoad > timeToStop)
{
record = false;
Time.captureFramerate = 0;
Debug.Log("record stopped !");
Application.Quit();
}
else if (Time.timeScale != 0)
{
//ScreenCapture.CaptureScreenshot(saveDir + "/" + imageIncrement.ToString("D" + 4) + ".png");
......@@ -112,11 +109,11 @@ public class CamRecorder : MonoBehaviour
imageIncrement++;
}
else
Time.captureFramerate = 0;
runOncePerFrame = false;
}
else
Time.captureFramerate = 0;
StartCoroutine(RecordDataScreen());
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment