Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void TakeScreenshot() {
- string timeStamp = DateTime.Now.ToLongTimeString();
- timeStamp = timeStamp.Remove( timeStamp.IndexOf( " " ) );
- timeStamp = timeStamp.Replace( ":", "" );
- mScreenshotPath = mDataPath + "/Screenshots/" + mDateString + "/";
- mScreenshotTexture.ReadPixels( new Rect( 0f, 0f, Screen.width, Screen.height ), 0, 0 );
- byte[] bytes = mScreenshotTexture.EncodeToPNG();
- if( !Directory.Exists( mScreenshotPath ) ) {
- Directory.CreateDirectory( mScreenshotPath );
- }
- mCachedScreenshots.Add( mScreenshotPath + mLevelName + "_" + "Screenshot_" + timeStamp + ".png", bytes );
- }
Add Comment
Please, Sign In to add comment