mirror of
https://github.com/tym1116/BH3.git
synced 2025-12-16 16:34:41 +01:00
25 lines
464 B
C#
25 lines
464 B
C#
using System.IO;
|
|
using UnityEngine;
|
|
|
|
namespace CinemaDirector
|
|
{
|
|
public class ScreenshotCapture : MonoBehaviour
|
|
{
|
|
public string Folder = "CaptureOutput";
|
|
|
|
public int FrameRate = 24;
|
|
|
|
private void Start()
|
|
{
|
|
Time.captureFramerate = FrameRate;
|
|
Directory.CreateDirectory(Folder);
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
string filename = string.Format("{0}/shot {1:D04}.png", Folder, Time.frameCount);
|
|
ScreenCapture.CaptureScreenshot(filename);
|
|
}
|
|
}
|
|
}
|