ゲーム画面を高画質で記録したい
次のスクリプトをシーンに追加して、InputAction で KeyBoard > PrintScreen を指定したらできました。
PrintScreenshot.cs
using UnityEngine; using UnityEngine.Experimental.Input; public class PrintScreenshot : MonoBehaviour { public InputAction inputAction; void Awake() { inputAction.performed += ctx => { ScreenCapture.CaptureScreenshot(System.IO.Path.Combine(Application.dataPath, "../ScreenShots/" + System.DateTime.Now.ToString("yyyyMMdd-HHmmss") + ".png"), 4); }; } public void OnEnable() { inputAction.Enable(); } public void OnDisable() { inputAction.Disable(); } }