1.8.3: Create new scene will now give the option to create it as single or additive

This commit is contained in:
Anders Ejlersen 2023-03-16 17:55:56 +01:00
parent de2745d68a
commit 305aa13317
3 changed files with 23 additions and 7 deletions

View file

@ -1,6 +1,12 @@
# Change Log
All notable changes to this project will be documented in this file.
## [1.8.3] - 2023-03-16
### Changed
- Create new scene will now give the option to create it as single or additive
## [1.8.2] - 2023-03-14
### Added

View file

@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.CompilerServices;
using System.Text;
@ -183,13 +184,22 @@ namespace Module.NavigationTool.Editor.Toolbar
{
if (GUI.Button(rect, styles.iconPlusSmall, styles.button))
{
if (!EditorUtility.DisplayDialog("Create new scene", "Are you sure that you want to create a new scene?", "Yes", "No"))
return;
try
{
int selection = EditorUtility.DisplayDialogComplex("Create new scene", "How do you want to add the scene?", "Single", "Additive", "Cancel");
Scene scene = EditorSceneManager.NewScene(NewSceneSetup.EmptyScene, NewSceneMode.Additive);
if (selection == 2)
return;
if (EditorUtility.DisplayDialog("Create new scene", "Save scene to disk?", "Yes", "No"))
EditorSceneManager.SaveScene(scene);
Scene scene = EditorSceneManager.NewScene(NewSceneSetup.EmptyScene, selection == 0 ? NewSceneMode.Single : NewSceneMode.Additive);
if (EditorUtility.DisplayDialog("Create new scene", "Save scene to disk?", "Yes", "No"))
EditorSceneManager.SaveScene(scene);
}
catch (Exception e)
{
EditorUtility.DisplayDialog("Failed to add scene", e.Message, "Ok");
}
}
GUI.Label(rect, LABEL_SCENE_CREATE, styles.labelCenter);

View file

@ -1,6 +1,6 @@
{
"name": "com.module.navigationtool",
"version": "1.8.2",
"version": "1.8.3",
"displayName": "Module.NavigationTool",
"description": "Support for navigation tools, like favorites, history and toolbars",
"unity": "2019.2",