mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-01-14 17:29:23 -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
28 lines
583 B
C#
28 lines
583 B
C#
namespace Editor;
|
|
|
|
public class GameEditorSession : SceneEditorSession
|
|
{
|
|
internal static GameEditorSession Current = null;
|
|
|
|
public SceneEditorSession Parent { get; init; }
|
|
|
|
public override bool IsPlaying => true;
|
|
|
|
public GameEditorSession( SceneEditorSession parent, Scene scene ) : base( scene )
|
|
{
|
|
Parent = parent;
|
|
|
|
Assert.IsNull( Current, "Attempted to create new GameEditorSession when one already exists!" );
|
|
Current = this;
|
|
}
|
|
|
|
public override void Destroy()
|
|
{
|
|
base.Destroy();
|
|
|
|
Current = null;
|
|
}
|
|
|
|
public override void StopPlaying() => Parent.StopPlaying();
|
|
}
|