Application.CaptureScreenshot 截屏


static function CaptureScreenshot (filename : string) : void

Description描述

Captures a screenshot at path filename   as a PNG file.

捕捉屏幕作为一个PNG文件保存在路径filename。简单来说就是截屏

If the file exists already, it will be   overwritten. This function does nothing if used from inside the web player or a   Dashboard widget.

如果文件已经存在,它将被覆盖。如果在web播放器或者Dashboard窗口中使用该函数,它将不做任何事情。

  • C#

  • JavaScript

using UnityEngine;using System.Collections;public class example : MonoBehaviour {void OnMouseDown() {Application.CaptureScreenshot("Screenshot.png");}}
function OnMouseDown() {Application.CaptureScreenshot("Screenshot.png");}


,