-
-
Save MarshMello0/11d761befab3dbd2e1143146f5fc14c3 to your computer and use it in GitHub Desktop.
[Unity] Hiding my UI and taking a screenshot in game at a higher resolution
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
private void Update() | |
{ | |
if (Input.GetKeyDown(kScreenshot)) | |
{ | |
StartCoroutine(TakeScreenShot()); | |
} | |
} | |
private IEnumerator TakeScreenShot() | |
{ | |
miniMap.SetActive(false); | |
yield return new WaitForSeconds(1); | |
ScreenCapture.CaptureScreenshot( | |
string.Format("{0}/screenshot_{1}_{2}_{3}.png", Directory.GetCurrentDirectory(), DateTime.Now.Hour, | |
DateTime.Now.Minute, DateTime.Now.Second), | |
10); | |
yield return new WaitForSeconds(1); | |
miniMap.SetActive(true); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment