Unity内屏幕截图

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);
        }
	}
}

猜你喜欢

转载自blog.csdn.net/X_King_Q/article/details/124492794