FiE-Game/Assets/Cinema Director/System/Runtime/Helpers/ScreenshotCapture.cs
2023-07-27 00:47:00 +05:00

26 lines
No EOL
622 B
C#

using UnityEngine;
namespace CinemaDirector
{
/// <summary>
/// Behaviour for capturing screenshots at each frame.
/// </summary>
public class ScreenshotCapture : MonoBehaviour
{
public string Folder = "CaptureOutput";
public int FrameRate = 24;
void Start()
{
Time.captureFramerate = FrameRate;
System.IO.Directory.CreateDirectory(Folder);
}
void Update()
{
string name = string.Format("{0}/shot {1:D04}.png", Folder, Time.frameCount);
Application.CaptureScreenshot(name);
}
}
}