Skip to content

Instantly share code, notes, and snippets.

@sapphire-al2o3
Created November 7, 2014 18:29
Show Gist options
  • Save sapphire-al2o3/10ba2a2cf3aaa1c8ca21 to your computer and use it in GitHub Desktop.
Save sapphire-al2o3/10ba2a2cf3aaa1c8ca21 to your computer and use it in GitHub Desktop.
Unityでスクリーンショットを保存するエディタ拡張のスクリプト
using UnityEngine;
using UnityEditor;
public class CaptureScreenshot : Editor
{
[MenuItem("Editor/Capture...")]
public static void Capture()
{
string path = EditorUtility.SaveFilePanel("Save Screenshot", Application.dataPath, "cap", "png");
if (!string.IsNullOrEmpty(path))
{
Application.CaptureScreenshot(path);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment