以下の内容はhttps://simplestar-tech.hatenablog.com/entry/2019/01/12/225522より取得しました。


Unity:高画質スクリーンショット

ゲーム画面を高画質で記録したい

次のスクリプトをシーンに追加して、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();
    }
}

参考記事

tsubakit1.hateblo.jp




以上の内容はhttps://simplestar-tech.hatenablog.com/entry/2019/01/12/225522より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14