Frontend menu + settings + saves foundation
Netcode frontend pattern: UITK main menu / pause / settings (MenuUi + controllers), on-demand world lifecycle (WorldLauncher/SessionRunner), GameBootstrap menu branch; Graphics/Audio settings (SettingsService/GameVolume); single-slot save foundation (SaveData/SaveService, born-correct load at director spawn, autosave on Siege->Calm + quit); RuntimePanelSettings + theme; BuildTool menu; 10 EditMode tests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using Unity.Entities;
|
||||
using Unity.NetCode;
|
||||
using UnityEngine;
|
||||
|
||||
namespace ProjectM.Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Client-only bootstrap that ensures the in-game pause overlay (Esc) exists once a session is running.
|
||||
/// Mirrors how HudSystem creates its UI at runtime — spawns one <see cref="PauseMenuController"/> GameObject
|
||||
/// in the active (Game) scene; the scene swap on Quit-to-Menu destroys it, and a fresh session's new client
|
||||
/// world spawns a new one. Client world only, so the menu's plain default world never spawns a pause overlay.
|
||||
/// </summary>
|
||||
[WorldSystemFilter(WorldSystemFilterFlags.ClientSimulation)]
|
||||
[UpdateInGroup(typeof(PresentationSystemGroup))]
|
||||
public partial class PauseMenuSystem : SystemBase
|
||||
{
|
||||
bool _spawned;
|
||||
|
||||
protected override void OnUpdate()
|
||||
{
|
||||
if (_spawned) return;
|
||||
_spawned = true;
|
||||
new GameObject("~PauseMenu").AddComponent<PauseMenuController>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user