Opening a scene/prefab no longer opens a new tab if one already exists. It will focus the existing tab like it did before (#3479)

https://files.facepunch.com/CarsonKompon/2025/November/27_09-14-PalevioletredMarten.mp4
This commit is contained in:
Carson Kompon
2025-11-27 12:26:41 -05:00
committed by GitHub
parent a6794e92af
commit 2d90d6bf55

View File

@@ -452,14 +452,14 @@ public partial class SceneEditorSession : Scene.ISceneEditorSession
{
var resource = ResourceLibrary.Get<Resource>( path );
/*if ( SceneEditorSession.Resolve( resource ) is PrefabEditorSession session )
{
session.MakeActive();
return;
}*/
if ( resource is SceneFile sceneFile )
{
if ( SceneEditorSession.Resolve( sceneFile ) is SceneEditorSession existingSession )
{
existingSession.MakeActive();
return existingSession;
}
var openingScene = Scene.CreateEditorScene();
using var _ = openingScene.Push();
@@ -472,6 +472,12 @@ public partial class SceneEditorSession : Scene.ISceneEditorSession
if ( resource is PrefabFile prefabFile )
{
if ( PrefabEditorSession.Resolve( prefabFile ) is PrefabEditorSession existingSession )
{
existingSession.MakeActive();
return existingSession;
}
var openingScene = PrefabScene.CreateForEditing();
using var _ = openingScene.Push();