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(); }
private void Exit() { this.Close(); var actual = PrefabCollectionWindow.GetWindow <PrefabCollectionWindow>(); actual.ChangeToNone(); EditorSceneManager.OpenScene(previousScene); }
//Creates the main window. public static void OpenWindow() { PrefabCollectionWindow window = GUIAuxiliar.OpenEditorWindow <PrefabCollectionWindow>(Style.TITLE_PREFAB_COLLECTION_WINDOW); window.minSize = new Vector2(350, 250); window.maxSize = new Vector2(350, 1000); PrefabCollectionWindow.selectObject = new SceneObjectContainer(); window.Show(); }
private void Exit() { this.Close(); var actual = PrefabCollectionWindow.GetWindow <PrefabCollectionWindow>(); AssetDatabase.DeleteAsset(scenePath); actual.ChangeToNone(); if (previousScene != ".") { EditorSceneManager.OpenScene(previousScene); } else { EditorSceneManager.OpenScene(SceneManager.GetSceneByBuildIndex(0).path); } }
public static PrefabCollectionCreatorWindow CreateWindow(PrefabCollectionWindow owner) { var window = GUIAuxiliar.OpenEditorWindow <PrefabCollectionCreatorWindow>("Collection Creator"); Paths.CreateFolderIfNotExist(Paths.FOLDER_RESOURCES_LEVEL_EDITOR, Paths.NAME_DATA_BASE); /* if (!AssetDatabase.IsValidFolder(Paths.FOLDER_DATA_BASE)) * { * AssetDatabase.CreateFolder(Paths.FOLDER_RESOURCES_LEVEL_EDITOR, Paths.NAME_DATA_BASE); * } */ window.ShowUtility(); window.dataBase = CreateInstance <PrefabDataBase>(); window.dataBase.Init(); window.dataBase.dataBaseName = "New"; window.dataBase.prefabList = new List <PrefabContainer>(); window.maxSize = new Vector2(300, 100); window.minSize = new Vector2(300, 100); window.owner = owner; return(window); }