Last active
October 7, 2021 11:22
-
-
Save makochang/f49c20ab58173fa2f87463d934e2ca73 to your computer and use it in GitHub Desktop.
Unityスクリーンショットを撮る
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class SS_Matsuda : MonoBehaviour | |
{ | |
private void Update() | |
{ | |
// スペースキーが押されたら | |
if (Input.GetKeyDown(KeyCode.Space)) | |
{ | |
// スクリーンショットを保存 | |
CaptureScreenShot("C:\\Users\\student\\Documents\\ScreenShot.png"); | |
} | |
} | |
// 画面全体のスクリーンショットを保存する | |
private void CaptureScreenShot(string filePath) | |
{ | |
Debug.Log(filePath); | |
ScreenCapture.CaptureScreenshot(filePath); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment