mirror of
https://github.com/FriendshipIsEpic/FiE-Game.git
synced 2024-12-02 17:57:59 +01:00
26 lines
622 B
C#
26 lines
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);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|