private void OnDisable() { EditorSceneManager.sceneOpened -= SceneOpend; EditorSceneManager.sceneSaved -= GetSceneInfo; EditorSceneManager.newSceneCreated -= ResetSceneInfo; if (helpWindow != null) { helpWindow.Close(); helpWindow = null; } }
private void OnGUI() { GetGUIStyles(); using (new EditorGUILayout.HorizontalScope()) { using (new EditorGUILayout.VerticalScope()) { EditorGUI.DrawRect(new Rect(0, 0, position.width, 30), titleBgColor); // EditorGUI.DropShadowLabel だとRichTextが使えなそうなので、色違いをズラして描画させる EditorGUI.LabelField(new Rect(14, 8, 300, 20), "<size=13><b><color=#444444>" + label_title + "</color></b></size>", labelStyle); EditorGUI.LabelField(new Rect(13, 7, 300, 20), "<size=13><b><color=#333333>" + label_title + "</color></b></size>", labelStyle); EditorGUI.LabelField(new Rect(12, 6, 300, 20), "<size=13><b><color=#222222>" + label_title + "</color></b></size>", labelStyle); EditorGUI.LabelField(new Rect(11, 5, 300, 20), "<size=13><b><color=#000000>" + label_title + "</color></b></size>", labelStyle); EditorGUI.LabelField(new Rect(10, 4, 300, 20), "<size=13><b><color=#ffd700>" + label_title + "</color></b></size>", labelStyle); } tempLastRect = GUILayoutUtility.GetLastRect(); if (GUI.Button(new Rect(tempLastRect.width - 28, tempLastRect.y + 10, 20, 20), EditorGUIUtility.IconContent("_Help"), titleStyle)) { var helpWindowSize = SceneLightSettingHelpWindow.windowSize; var helpWindowPosX = (Screen.currentResolution.width - helpWindowSize.x) / 2; var helpWindowPosY = (Screen.currentResolution.height - helpWindowSize.y) / 2; helpWindow = EditorWindow.GetWindow <SceneLightSettingHelpWindow>(false, "", true); helpWindow.titleContent = new GUIContent("Scene Light Setting Help Window"); var icon = EditorGUIUtility.IconContent("Lightmapping"); if (icon != null) { helpWindow.titleContent.image = icon.image; } helpWindow.position = new Rect(helpWindowPosX, helpWindowPosY, helpWindowSize.x, helpWindowSize.y); helpWindow.maxSize = helpWindow.minSize = helpWindowSize; } } GUILayout.Space(30); scrollPos = EditorGUILayout.BeginScrollView(scrollPos, GUILayout.ExpandHeight(true)); EditorGUILayout.LabelField(label_SceneName); using (new EditorGUILayout.HorizontalScope()) { EditorGUILayout.Space(); EditorGUI.BeginDisabledGroup(true); EditorGUILayout.TextField(currentSceneName, GUILayout.Width(320)); EditorGUI.EndDisabledGroup(); EditorGUILayout.Space(); } EditorGUILayout.LabelField(label_ScenePath); using (new EditorGUILayout.HorizontalScope()) { EditorGUILayout.Space(); EditorGUI.BeginDisabledGroup(true); EditorGUILayout.TextField(currentSceneFolderPath, textStyle, GUILayout.Width(320), GUILayout.ExpandHeight(true)); EditorGUI.EndDisabledGroup(); EditorGUILayout.Space(); } DrawUILine(Color.yellow); using (new BackgroundColorScope(exportGroupColor)) { using (new EditorGUILayout.VerticalScope(GUI.skin.box)) { ExportLightSettingGroup(); } } GUILayout.Space(5); using (new BackgroundColorScope(importGroupColor)) { using (new EditorGUILayout.VerticalScope(GUI.skin.box)) { ImportLightSettingGroup(); } } EditorGUILayout.EndScrollView(); GUILayout.Space(5); }