Skip to content

Instantly share code, notes, and snippets.

@bzgeb
Created October 2, 2013 19:19
Show Gist options
  • Save bzgeb/6799103 to your computer and use it in GitHub Desktop.
Save bzgeb/6799103 to your computer and use it in GitHub Desktop.
Unity Screenshot Controller Thing
using UnityEngine;
using System.Collections;
public class ScreenshotController : MonoBehaviour
{
void Update() {
if ( Input.GetKeyDown( KeyCode.Alpha1 ) ) {
Application.CaptureScreenshot( "ScreenshotSize1.png", 1 );
}
if ( Input.GetKeyDown( KeyCode.Alpha2 ) ) {
Application.CaptureScreenshot( "ScreenshotSize2.png", 2 );
}
if ( Input.GetKeyDown( KeyCode.Alpha3 ) ) {
Application.CaptureScreenshot( "ScreenshotSize3.png", 3 );
}
if ( Input.GetKeyDown( KeyCode.Alpha4 ) ) {
Application.CaptureScreenshot( "ScreenshotSize4.png", 4 );
}
if ( Input.GetKeyDown( KeyCode.Alpha5 ) ) {
Application.CaptureScreenshot( "ScreenshotSize5.png", 5 );
}
if ( Input.GetKeyDown( KeyCode.Alpha6 ) ) {
Application.CaptureScreenshot( "ScreenshotSize6.png", 6 );
}
if ( Input.GetKeyDown( KeyCode.Alpha7 ) ) {
Application.CaptureScreenshot( "ScreenshotSize7.png", 7 );
}
if ( Input.GetKeyDown( KeyCode.Alpha8 ) ) {
Application.CaptureScreenshot( "ScreenshotSize8.png", 8 );
}
if ( Input.GetKeyDown( KeyCode.Alpha9 ) ) {
Application.CaptureScreenshot( "ScreenshotSize9.png", 9 );
}
if ( Input.GetKeyDown( KeyCode.Alpha0 ) ) {
Application.CaptureScreenshot( "ScreenshotSize10.png", 10 );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment