using Unity.Entities; using Unity.NetCode; using UnityEngine; namespace ProjectM.Client { /// /// 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 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. /// [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(); } } }