Created
January 30, 2016 16:12
-
-
Save murapong/c330fb0d7d652baffd52 to your computer and use it in GitHub Desktop.
UnityでスクリーンショットをTexture2D形式で取得する
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
Texture2D CaptureScreenshot() | |
{ | |
Texture2D texture = new Texture2D(Screen.width, Screen.height, TextureFormat.RGB24, true); | |
texture.ReadPixels(new Rect(0, 0, Screen.width, Screen.height), 0, 0, true); | |
texture.Apply(); | |
return texture; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment