1.8.3: Create new scene will now give the option to create it as single or additive
This commit is contained in:
parent
de2745d68a
commit
305aa13317
3 changed files with 23 additions and 7 deletions
|
|
@ -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");
|
||||
|
||||
if (selection == 2)
|
||||
return;
|
||||
|
||||
Scene scene = EditorSceneManager.NewScene(NewSceneSetup.EmptyScene, NewSceneMode.Additive);
|
||||
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);
|
||||
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue