mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-01-15 01:39:39 -05:00
* 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
26 lines
499 B
C#
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();
|
|
}
|
|
}
|