Radar-Sichtbarkeitsgates, Hider-Pings im Seek + Ping-Countdown
Radar: nur sichtbar bei >=1 Target, in First-Person und in der Seek-Phase (Overlay-Kamera getoggelt, Blip-Skripte laufen weiter). Singleton fuer Server-Zugriff. GameModeManager: Kamera + Tab-Moduswechsel erst ab gebundenem Lobby-Player (Inert-Zustand ohne Player, Orbit-Input geparkt). MatchManager: Server tickt im Seek alle radarPingInterval (30s) und broadcastet noch nicht gefundene Hider (NetworkObjectId + radarPingLifetime 3s) nur an Hunter-Clients; jeder Hunter loest lokal auf und spawnt Blips. Ping-Loop in die Seek-Coroutine gefaltet (EndMatch stoppt ihn mit). MatchHud: Ping-Countdown lokal aus Seek-Start + Kadenz berechnet, Format m:ss (0:30..0:01), ausserhalb Seek / bei deaktivierten Pings 0:00. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
23b51d07a4
commit
de82ce25de
4 files changed
+240
-12
No files matched your search
@@ -80,8 +80,14 @@ public class GameModeManager : MonoBehaviour
|
||||
|
||||
private void Start()
|
||||
{
|
||||
if (_modes.Count > 0)
|
||||
// Go live only when this scene already holds a player to control (a scene-placed avatar). In the
|
||||
// networked Main scene the avatar spawns on connect, so the manager stays inert - no camera control,
|
||||
// no mode switching - until BindLocalPlayer promotes it once the lobby avatar exists. Without this,
|
||||
// the pre-spawn menu already lets you orbit the camera and Tab-cycle modes with no player.
|
||||
if (player && _modes.Count > 0)
|
||||
SwitchTo(Mathf.Clamp(startModeIndex, 0, _modes.Count - 1));
|
||||
else
|
||||
EnterNoPlayerState();
|
||||
}
|
||||
|
||||
/// <summary>Registers the modes for the current context. Without a role (no networked avatar yet,
|
||||
@@ -228,22 +234,35 @@ public class GameModeManager : MonoBehaviour
|
||||
/// </summary>
|
||||
public void ReleaseToNoPlayer()
|
||||
{
|
||||
_paused = false;
|
||||
_resumeIndex = -1;
|
||||
|
||||
TearDownActiveMode();
|
||||
_modes.Clear();
|
||||
ClearPlayerBindings();
|
||||
EnterNoPlayerState();
|
||||
}
|
||||
|
||||
// The cycle is empty (no SwitchTo runs), so notify mode-following UI explicitly - otherwise the
|
||||
// paint HUD (hides only via ModeChanged) would stay open after a shutdown during PaintMode.
|
||||
ModeChanged?.Invoke(null);
|
||||
/// <summary>
|
||||
/// Puts the manager in the inert "no local player" state: no active mode, the persistent orbit input
|
||||
/// parked in Disabled (it otherwise re-locks the cursor every frame while AlwaysActive, so a one-off
|
||||
/// unlock would be reverted next frame) and the cursor freed. Entered at startup in a networked scene
|
||||
/// before the lobby avatar spawns, and again after it is gone (see <see cref="ReleaseToNoPlayer"/>).
|
||||
/// <see cref="BindLocalPlayer"/> / <see cref="BindSpectator"/> promote out of it. With no active mode
|
||||
/// (_activeIndex < 0) Update ignores the switch key, so Tab cannot bootstrap a mode from here.
|
||||
/// </summary>
|
||||
private void EnterNoPlayerState()
|
||||
{
|
||||
_paused = false;
|
||||
_resumeIndex = -1;
|
||||
_activeIndex = -1;
|
||||
|
||||
if (cameraInput)
|
||||
cameraInput.LookMode = ThirdPersonOrbitInput.OrbitLookMode.Disabled;
|
||||
|
||||
// Belt-and-braces explicit release (covers the orbit input being absent/disabled).
|
||||
InputUtil.SetCursorLocked(false);
|
||||
|
||||
// The cycle is inert (no SwitchTo runs), so notify mode-following UI explicitly - otherwise the
|
||||
// paint HUD (hides only via ModeChanged) would stay open after a shutdown during PaintMode.
|
||||
ModeChanged?.Invoke(null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -299,6 +318,9 @@ public class GameModeManager : MonoBehaviour
|
||||
{
|
||||
if (_paused) return;
|
||||
if (_modes.Count == 0) return;
|
||||
// No active mode = the inert no-player state (pre-lobby, or after ReleaseToNoPlayer). Ignore the
|
||||
// switch key and Tick so Tab can't bootstrap a mode and no camera rig is driven until a bind.
|
||||
if (_activeIndex < 0) return;
|
||||
|
||||
// Resolution (the reveal window) is watch-only: force out of Paint and keep the switch key from
|
||||
// re-entering. No restore needed - the end-of-match respawn rebuilds the cycle at index 0.
|
||||
|
||||
Reference in new issue
Block a user