Skip to content

Instantly share code, notes, and snippets.

@HassakuTb
Last active June 28, 2016 02:42
Show Gist options
  • Save HassakuTb/f46a8d65f98dd65f7e718f0fabddf8f6 to your computer and use it in GitHub Desktop.
Save HassakuTb/f46a8d65f98dd65f7e718f0fabddf8f6 to your computer and use it in GitHub Desktop.
Screenshot extension for Unity Editor
/**
Screenshot.cs
Copyright (c) 2016 Hassaku
This software is released under the MIT License.
http://opensource.org/licenses/mit-license.php
*/
using UnityEngine;
using UnityEditor;
public class Screenshot : EditorWindow{
[MenuItem ("Extension/Screenshot")]
public static void Capture() {
if (!EditorApplication.isPlaying) return;
string filename = System.DateTime.Now.ToString("yyyy-MM-dd_hh-mm-ss") + ".png";
Application.CaptureScreenshot(filename);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment