Skip to content

Instantly share code, notes, and snippets.

@RimuruDev
Created November 28, 2022 17:44
Show Gist options
  • Save RimuruDev/897cd0924f941e4416e238f37f258f36 to your computer and use it in GitHub Desktop.
Save RimuruDev/897cd0924f941e4416e238f37f258f36 to your computer and use it in GitHub Desktop.
ScreenshotGameScreen in Unity #RimuruDev
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using System.IO;
namespace RimuruDev.Editors
{
public class ScreenshotGameScreen : Editor
{
[MenuItem("Tool/Take Screenshot")]
public static void TakeSkreenshot()
{
var name = $"Screenshot-{GUID.Generate()}.png";
Directory.CreateDirectory("Tool/Screenshot");
ScreenCapture.CaptureScreenshot($"Tool/Screenshot/{name}", 10);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment