using UnityEditor; using UnityEngine; public class ScreenTest : MonoBehaviour { [MenuItem("Tools/snapshot")] public static void ScreenShot() { ScreenCapture.CaptureScreenshot("Assets/Editor/snapshot.png"); } }