文章目录
一、Unity提供的ScreenCapture取图像接口
众所周知,Unity提供了ScreenCapture API用来获取引擎最终渲染到屏幕的图像:
二、我们一个一个看API:
1.CaptureScreenshot是一个很单纯的给一个文件名将屏幕保存一张图像到磁盘的接口,而实际项目中我们需要对屏幕截图做很多操作,所以该API不太适用。
using UnityEngine;
// Generate a screenshot and save it to disk with the name SomeLevel.png.
public class ExampleScript : MonoBehaviour
{
void