截屏脚本

发布时间:2017-4-25 6:46:46 编辑:www.fx114.net 分享查询网我要评论
本篇文章主要介绍了"截屏脚本",主要涉及到截屏脚本方面的内容,对于截屏脚本感兴趣的同学可以参考一下。

//TakeScreenshot.cs// TODO:// By default, screenshot files are placed next to the executable bundle -- we don't want this in a// shipping game, as it will fail if the user doesn't have write access to the Applications folder.// Instead we should place the screenshots on the user's desktop. However, the ~/ notation doesn't// work, and Unity doesn't have a mechanism to return special paths. Therefore, the correct way to// solve this is probably with a plug-in to return OS specific special paths.// Mono/.NET has functions to get special paths... see discussion page. --Aarkuusing UnityEngine;using System.Collections;public class TakeScreenshot : MonoBehaviour{        private int screenshotCount = 0;            // Check for screenshot key each frame    void Update()    {        // take screenshot on up->down transition of F9 key        if (Input.GetKeyDown(KeyCode.F2))        {                    string screenshotFilename;            do            {                screenshotCount++;                screenshotFilename = "screenshot" + screenshotCount + ".png";            } while (System.IO.File.Exists(screenshotFilename));                        Application.CaptureScreenshot(screenshotFilename);        }    }}

上一篇:【如何手动清除系统中的iTunes备份文件】_8.26
下一篇:【转】AI_自动寻怪,自动追击

相关文章

关键词: 截屏脚本

相关评论

本站评论功能暂时取消,后续此功能例行通知。

一、不得利用本站危害国家安全、泄露国家秘密,不得侵犯国家社会集体的和公民的合法权益,不得利用本站制作、复制和传播不法有害信息!

二、互相尊重,对自己的言论和行为负责。

好贷网好贷款