Unity内屏幕截图
一、
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Screen : MonoBehaviour {
private int screenIndex = 0;
// Update is called once per frame
void Update () {
if (Input.GetKeyDown(KeyCode.P))
{
screenIndex++;
ScreenCapture.CaptureScreenshot("截图.png");
Debug.Log("截图成功:" + screenIndex);
}
}
}