public static void OpenRegionSceneEditor(LevelRegion region = null) { previousScene = GUIAuxiliar.OpenNewScene("Region Editor", out var actualScene); RegionEditorWindow window = GUIAuxiliar.OpenEditorWindow <RegionEditorWindow>(Style.TITLE_REGION_EDITOR_WINDOW); if (String.IsNullOrEmpty(previousScene)) { return; } //RegionEditorWindow window = (RegionEditorWindow)EditorWindow.GetWindow(typeof(RegionEditorWindow)); if (!AssetDatabase.IsValidFolder(Paths.FOLDER_MAPS)) { AssetDatabase.CreateFolder(Paths.FOLDER_PREFABS, Paths.NAME_MAPS); } window.ReStart(); if (region != null) { Editlevel = region; window.LoadGrid(); } window.FindLevel(); Selection.activeObject = Editlevel.terrainGrid.gameObject; SceneView.lastActiveSceneView.FrameSelected(); window.Show(); //OpenWindow(); PrefabCollectionWindow.OpenWindow(); }
//[MenuItem(Paths.MENU_REGION_EDITOR, false, 3)] //Creates the main window. public static void OpenWindow() { if (!AssetDatabase.IsValidFolder(Paths.FOLDER_MAPS)) { AssetDatabase.CreateFolder(Paths.FOLDER_PREFABS, Paths.NAME_MAPS); } RegionEditorWindow window = (RegionEditorWindow)EditorWindow.GetWindow(typeof(RegionEditorWindow)); window.titleContent = Style.TITLE_LEVEL_EDITOR_WINDOW; window.Show(); }