#if UNITY_EDITOR using Unity.Entities; using Unity.NetCode; using UnityEngine.InputSystem; namespace ProjectM.Client { /// /// EDITOR-ONLY dev hotkey to switch the local player's class while playtesting: F1 = Warrior, /// F2 = Ranger. The 's Class buttons only live in the DevSandbox scene, so this /// keybind makes the swap reachable in the real menu -> Game flow too (no scene wiring needed). It enqueues the /// SAME authoritative (DebugOp.SetClass) the overlay buttons /// do, via — the server strips/re-seeds the class traits, swaps the Fire /// ability, and heals a living player to the new class's max. Reads directly (no /// .inputactions edit) and edge-detects with wasPressedThisFrame. Stripped from player builds (#if UNITY_EDITOR). /// [WorldSystemFilter(WorldSystemFilterFlags.ClientSimulation)] public partial class ClassSwitchHotkeySystem : SystemBase { protected override void OnUpdate() { var kb = Keyboard.current; if (kb == null) return; if (kb.f1Key.wasPressedThisFrame) DebugCommandSendSystem.SetWarrior(); else if (kb.f2Key.wasPressedThisFrame) DebugCommandSendSystem.SetRanger(); } } } #endif