Files
sbox-public/engine/Sandbox.Tools/Scene/Session/SceneEditorSession.Game.cs
Sol Williams 80aa601771 Restore separate GameEditorSessions (#3453)
* SceneEditorSession: make game vs editor scenes more distinct, Scene is whichever is currently active

* Route prefab update, model reload etc events to both scenes if needed

* SceneTree update checking a bit cleaner

* Bring back GameEditorSessions instead, so undo, selection etc can all be linked 1:1 with scenes again

* tweak and tidy
2025-11-26 16:05:23 +00:00

26 lines
499 B
C#

namespace Editor;
partial class SceneEditorSession
{
/// <summary>
/// The game session of this editor session, if playing.
/// </summary>
public GameEditorSession GameSession { get; private set; }
public virtual bool IsPlaying => GameSession != null;
public void SetPlaying( Scene scene )
{
GameSession = new GameEditorSession( this, scene );
GameSession.MakeActive();
}
public virtual void StopPlaying()
{
GameSession?.Destroy();
GameSession = null;
MakeActive();
}
}