Merge remote-tracking branch 'origin/master' into 1.6

This commit is contained in:
Wojtek Figat
2023-05-05 11:41:32 +02:00
15 changed files with 96 additions and 16 deletions

View File

@@ -77,6 +77,8 @@ namespace FlaxEditor.SceneGraph.Actors
}
contextMenu.AddButton("Save scene", OnSave).LinkTooltip("Saves this scene.").Enabled = IsEdited && !Editor.IsPlayMode;
contextMenu.AddButton("Unload scene", OnUnload).LinkTooltip("Unloads this scene.").Enabled = Editor.Instance.StateMachine.CurrentState.CanChangeScene;
if (Level.ScenesCount > 1)
contextMenu.AddButton("Unload all but this scene", OnUnloadAllButSelectedScene).LinkTooltip("Unloads all of the active scenes except for the selected scene.").Enabled = Editor.Instance.StateMachine.CurrentState.CanChangeScene;
base.OnContextMenu(contextMenu);
}
@@ -95,5 +97,10 @@ namespace FlaxEditor.SceneGraph.Actors
{
Editor.Instance.Scene.CloseScene(Scene);
}
private void OnUnloadAllButSelectedScene()
{
Editor.Instance.Scene.CloseAllScenesExcept(Scene);
}
}
}