Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Created June 7, 2014 04:16
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 tsubaki/71de422fbc55bbeb716c to your computer and use it in GitHub Desktop.
Save tsubaki/71de422fbc55bbeb716c to your computer and use it in GitHub Desktop.
もっと簡単に高画質なスクリーンショットを撮影する
using UnityEngine;
using System.Collections;
public class TakeShot : MonoBehaviour {
public float maxScale = 2048;
void OnGUI()
{
if( GUILayout.Button("take"))
{
float max = Mathf.Max(Screen.width, Screen.height);
int scale = Mathf.RoundToInt( maxScale / max);
Application.CaptureScreenshot("image.png", scale);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment