UnityAPI手册-2019.4官网版
文集大纲加载中……
本文档使用 MrDoc 发布
-
+
首页
Time.captureDeltaTime
# [Time](https://docs.unity3d.com/cn/2019.4/ScriptReference/Time.html).captureDeltaTime public static float **captureDeltaTime** ; ## 描述 减慢游戏播放时间,以便在帧之间保存屏幕截图。 如果该属性具有非零值,则以 `captureDeltaTime` 为间隔进行帧更新,而与实际时间和渲染帧所需的时间无关。如果需要捕获帧率恒定的电影并在帧之间留出充足的时间来保存屏幕图像,该属性很有用。 ``` using UnityEngine; using System.Collections; // Capture frames as a screenshot sequence. Images are // stored as PNG files in a folder - these can be combined into // a movie using image utility software (eg, QuickTime Pro). public class ExampleClass : MonoBehaviour { // The folder to contain our screenshots. // If the folder exists we will append numbers to create an empty folder. public string folder = "ScreenshotFolder"; public int frameRate = 25; void Start() { // Set the playback framerate (real time will not relate to game time after this). Time.captureDeltaTime = 1.0f / frameRate; // Create the folder System.IO.Directory.CreateDirectory(folder); } void Update() { // Append filename to folder name (format is '0005 shot.png"') string name = string.Format("{0}/{1:D04} shot.png", folder, Time.frameCount); // Capture the screenshot to the specified file. ScreenCapture.CaptureScreenshot(name); } } ```
da
2022年6月21日 11:26
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
关于 MrDoc
觅思文档MrDoc
是
州的先生
开发并开源的在线文档系统,其适合作为个人和小型团队的云笔记、文档和知识库管理工具。
如果觅思文档给你或你的团队带来了帮助,欢迎对作者进行一些打赏捐助,这将有力支持作者持续投入精力更新和维护觅思文档,感谢你的捐助!
>>>捐助鸣谢列表
微信
支付宝
QQ
PayPal
Markdown文件
分享
链接
类型
密码
更新密码