Skip to content

Instantly share code, notes, and snippets.

@MarshMello0
Created May 14, 2019 09:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarshMello0/11d761befab3dbd2e1143146f5fc14c3 to your computer and use it in GitHub Desktop.
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
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