public override void OnInspectorGUI() { EditorGUILayout.HelpBox("This asset contains the settings used by the ScreenshotWindow.", MessageType.Info); if (GUILayout.Button("Open Screenshot Window")) { ScreenshotWindow.Init(); } }
void OnDisable() { m_Window = null; #if UNITY_2017_2_OR_NEWER EditorApplication.playModeStateChanged -= StateChange; #else EditorApplication.playmodeStateChanged -= StateChange; #endif SceneView.onSceneGUIDelegate -= HandleEventsDelegate; }
void OnEnable() { m_Window = this; InitConfig(); #if UNITY_2017_2_OR_NEWER EditorApplication.playModeStateChanged += StateChange; #else EditorApplication.playmodeStateChanged += StateChange; #endif SceneView.onSceneGUIDelegate += HandleEventsDelegate; }
public static void Init() { ScreenshotWindow window = (ScreenshotWindow)EditorWindow.GetWindow(typeof(ScreenshotWindow), false, "Screenshot"); window.Show(); }
public override void OnInspectorGUI() { // catch events m_ScreenshotManager.HandleEditorHotkeys(); serializedObject.Update(); EditorGUILayout.BeginVertical(GUI.skin.box); m_ConfigDrawer.DrawCaptureModeGUI(); EditorGUILayout.EndVertical(); EditorGUILayout.Separator(); EditorGUILayout.BeginVertical(GUI.skin.box); m_ConfigDrawer.DrawFolderGUI(); EditorGUILayout.EndVertical(); EditorGUILayout.Separator(); EditorGUILayout.BeginVertical(GUI.skin.box); m_ConfigDrawer.DrawNameGUI(); EditorGUILayout.EndVertical(); EditorGUILayout.Separator(); if (m_ScreenshotManager.m_Config.m_CaptureMode != ScreenshotTaker.CaptureMode.FIXED_GAMEVIEW) { EditorGUILayout.BeginVertical(GUI.skin.box); m_ConfigDrawer.DrawResolutionGUI(); EditorGUILayout.EndVertical(); EditorGUILayout.Separator(); } EditorGUILayout.BeginVertical(GUI.skin.box); m_ConfigDrawer.DrawCamerasGUI(); EditorGUILayout.EndVertical(); EditorGUILayout.Separator(); EditorGUILayout.BeginVertical(GUI.skin.box); m_ConfigDrawer.DrawOverlaysGUI(); EditorGUILayout.EndVertical(); EditorGUILayout.Separator(); EditorGUILayout.BeginVertical(GUI.skin.box); m_ConfigDrawer.DrawCompositionGUI(); EditorGUILayout.EndVertical(); EditorGUILayout.Separator(); EditorGUILayout.BeginVertical(GUI.skin.box); m_ConfigDrawer.DrawBatchesGUI(); EditorGUILayout.EndVertical(); EditorGUILayout.Separator(); EditorGUILayout.BeginVertical(GUI.skin.box); m_ConfigDrawer.DrawPreviewGUI(); if (GUILayout.Button("Update")) { m_ScreenshotManager.UpdatePreview(); } EditorGUILayout.EndVertical(); EditorGUILayout.Separator(); EditorGUILayout.BeginVertical(GUI.skin.box); m_ConfigDrawer.DrawCaptureGUI(); DrawCaptureButtonsGUI(); EditorGUILayout.EndVertical(); EditorGUILayout.Separator(); EditorGUILayout.BeginVertical(GUI.skin.box); m_ConfigDrawer.DrawHotkeysGUI(); EditorGUILayout.EndVertical(); EditorGUILayout.Separator(); EditorGUILayout.BeginVertical(GUI.skin.box); m_ConfigDrawer.DrawUtilsGUI(); EditorGUILayout.Separator(); if (GUILayout.Button("Reset state")) { m_ScreenshotManager.Reset(); } if (GUILayout.Button("Clear cache")) { m_ScreenshotManager.ClearCache(); } EditorGUILayout.EndVertical(); EditorGUILayout.Separator(); EditorGUILayout.BeginVertical(GUI.skin.box); m_ConfigDrawer.DrawUsage(); EditorGUILayout.EndVertical(); EditorGUILayout.Separator(); #if ULTIMATE_SCREENSHOT_DEBUG EditorGUILayout.BeginVertical(GUI.skin.box); DrawDebugGUI(); EditorGUILayout.EndVertical(); EditorGUILayout.Separator(); #endif EditorGUILayout.Separator(); EditorGUILayout.Separator(); EditorGUILayout.Separator(); ScreenshotWindow.DrawSupportGUI(); EditorGUILayout.Separator(); EditorGUILayout.Separator(); EditorGUILayout.Separator(); ScreenshotWindow.DrawContactGUI(); serializedObject.ApplyModifiedProperties(); // DrawDefaultInspector (); }