Created
November 28, 2022 17:44
-
-
Save RimuruDev/897cd0924f941e4416e238f37f258f36 to your computer and use it in GitHub Desktop.
ScreenshotGameScreen in Unity #RimuruDev
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 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