一:最简单的生成方法:
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ScreenShot : MonoBehaviour
{
void Start()
{
StartScreenShot();
}
void StartScreenShot()
{
//创建桌面路径
string path = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
//保存图片名字
string imageName = "生成图片" + ".png";
Application.CaptureScreenshot(path + "/" + imageName);
// ScreenCapture.CaptureScreenshot(path + "/" + imageName);
Debug.Log(path);
}
}