Minor tweak for #2003
This commit is contained in:
@@ -73,7 +73,11 @@ namespace FlaxEditor.Content
|
||||
/// <inheritdoc />
|
||||
public override void OnContentWindowContextMenu(ContextMenu menu, ContentItem item)
|
||||
{
|
||||
menu.AddButton("Open additionally", () => { Editor.Instance.Scene.OpenScene(((SceneItem)item).ID, true); });
|
||||
var id = ((SceneItem)item).ID;
|
||||
if (Level.FindScene(id) == null)
|
||||
{
|
||||
menu.AddButton("Open (additive)", () => { Editor.Instance.Scene.OpenScene(id, true); });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ namespace FlaxEditor.Windows
|
||||
if (unloadedScenes.Count > 0)
|
||||
{
|
||||
contextMenu.AddSeparator();
|
||||
var childCM = contextMenu.GetOrAddChildMenu("Add Scene");
|
||||
var childCM = contextMenu.GetOrAddChildMenu("Open Scene");
|
||||
foreach (var sceneGuid in unloadedScenes)
|
||||
{
|
||||
if (FlaxEngine.Content.GetAssetInfo(sceneGuid, out var unloadedScene))
|
||||
|
||||
@@ -439,7 +439,7 @@ public:
|
||||
|
||||
bool Do() const override
|
||||
{
|
||||
auto scene = Scripting::FindObject<Scene>(TargetScene);
|
||||
auto scene = Level::FindScene(TargetScene);
|
||||
if (!scene)
|
||||
return true;
|
||||
return unloadScene(scene);
|
||||
|
||||
Reference in New Issue
Block a user