Created
March 21, 2022 15:48
-
-
Save valadriadotcom/4112afcf2327c8b7ed7c2d7fe8815211 to your computer and use it in GitHub Desktop.
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
// Capture a screenshot in Unity | |
void CaptureScreenshot () { | |
System.DateTime moment = System.DateTime.Now; | |
string dateSlug = moment.ToString("yyyy-MM-dd_hh-mm"); // e.g. 2020-10-31_04-20 | |
string slug = (dateSlug + "-f" + Time.frameCount); | |
string filename = ("Screenshot_" + slug + ".png"); | |
string path = ("Screenshots/" + filename); | |
ScreenCapture.CaptureScreenshot(path); | |
Debug.Log("CaptureScreenshot() path: " + path); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment