Created
June 7, 2014 04:16
-
-
Save tsubaki/71de422fbc55bbeb716c to your computer and use it in GitHub Desktop.
もっと簡単に高画質なスクリーンショットを撮影する
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
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