Skip to content

Instantly share code, notes, and snippets.

@heybdj
Created March 17, 2016 15:21
Show Gist options
  • Save heybdj/642c22e7d10c1bd5c7fc to your computer and use it in GitHub Desktop.
Save heybdj/642c22e7d10c1bd5c7fc to your computer and use it in GitHub Desktop.
Captures a screenshot of the game while in Play mode
using UnityEngine;
using UnityEditor;
using System.Collections;
public class TakeScreenshot : ScriptableObject {
[MenuItem ("Assets/Screenshot/Capture 1X")]
static public void CaptureScreenshot1X() {
Application.CaptureScreenshot( "Screenshot1X.png" );
}
[MenuItem ("Assets/Screenshot/Capture 2X")]
static public void CaptureScreenshot2X() {
Application.CaptureScreenshot( "Screenshot2X.png", 2 );
}
[MenuItem ("Assets/Screenshot/Capture 4X")]
static public void CaptureScreenshot4X() {
Application.CaptureScreenshot( "Screenshot4X.png", 4 );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment