void OnGUI() { _savePath = EditorGUILayout.TextField("SavePath", _savePath); _saveName = EditorGUILayout.TextField("SaveName", _saveName); _captureMode = (ScreenCapture.StereoScreenCaptureMode)EditorGUILayout.EnumPopup("Stereo Screen Capture mode", _captureMode); bool isDirectory = Directory.Exists(_savePath); string resultPath = Path.Combine(_savePath, _saveName); using (new GUILayout.HorizontalScope()) { GUILayout.Label("Result Path"); GUILayout.Box(resultPath); } GUI.enabled = isDirectory; DoEditor(resultPath); GUI.enabled = true; if (!isDirectory) { EditorGUILayout.HelpBox("Save path must be a directory!", MessageType.Error); } if (string.IsNullOrWhiteSpace(_saveName)) { EditorGUILayout.HelpBox("Save name must be written!", MessageType.Error); } if (File.Exists(resultPath)) { EditorGUILayout.HelpBox("There's a file that exist with the same name, beware that you might override the original file", MessageType.Info); } // == is playing == }
private static extern Texture2D CaptureScreenshotAsTexture(int superSize, ScreenCapture.StereoScreenCaptureMode stereoScreenCaptureMode);
private static extern void CaptureScreenshot(string filename, [DefaultValue("1")] int superSize, [DefaultValue("1")] ScreenCapture.StereoScreenCaptureMode CaptureMode);
public static Texture2D CaptureScreenshotAsTexture(ScreenCapture.StereoScreenCaptureMode stereoCaptureMode) { return(ScreenCapture.CaptureScreenshotAsTexture(1, stereoCaptureMode)); }
public static void CaptureScreenshot(string filename, ScreenCapture.StereoScreenCaptureMode stereoCaptureMode) { ScreenCapture.CaptureScreenshot(filename, 1, stereoCaptureMode); }