private void DoBuild() { this.PrefabOutputPath = this.PrefabOutputPath.Trim(); this.DataOutputPath = this.DataOutputPath.Trim(); string resolvedPrefabPath = this.GetResolvedPrefabPath(); string resolvedDataPath = this.GetResolvedDataPath(); if (this.ValidateAssetPath("prefab", resolvedPrefabPath) && this.ValidateAssetPath("data asset", resolvedDataPath)) { // Confirm action with user if prefab and/or data asset already exist. bool outputPrefabAlreadyExists = File.Exists(Path.Combine(Directory.GetCurrentDirectory(), resolvedPrefabPath)); bool outputDataAlreadyExists = File.Exists(Path.Combine(Directory.GetCurrentDirectory(), resolvedDataPath)); if (outputPrefabAlreadyExists || outputDataAlreadyExists) { if (!EditorUtility.DisplayDialog( TileLang.Text("Warning, Output prefab or data asset already exists!"), TileLang.Text("Do you really want to overwrite?"), TileLang.ParticularText("Action", "Yes"), TileLang.ParticularText("Action", "No") )) { return; } } BuildUtility.BuildPrefab(this.TileSystem, resolvedDataPath, resolvedPrefabPath); this.Close(); } }
private void DrawToolbar() { GUILayout.BeginHorizontal(EditorStyles.toolbar); if (GUILayout.Button(TileLang.OpensWindow(TileLang.ParticularText("Action", "Create Tile System")), EditorStyles.toolbarButton)) { CreateTileSystemWindow.ShowWindow(); GUIUtility.ExitGUI(); } GUILayout.FlexibleSpace(); if (GUILayout.Button(TileLang.OpensWindow(TileLang.ParticularText("Action", "Build")), RotorzEditorStyles.Instance.ToolbarButtonPadded)) { BuildUtility.BuildScene(); GUIUtility.ExitGUI(); } EditorGUILayout.Space(); if (GUILayout.Button(RotorzEditorStyles.Skin.SortAsc, EditorStyles.toolbarButton)) { EditorTileSystemUtility.SortTileSystemsAscending(); this.Repaint(); GUIUtility.ExitGUI(); } if (GUILayout.Button(RotorzEditorStyles.Skin.SortDesc, EditorStyles.toolbarButton)) { EditorTileSystemUtility.SortTileSystemsDescending(); this.Repaint(); GUIUtility.ExitGUI(); } GUILayout.EndHorizontal(); }