Files
adminandClaude Fable 5 6c03e5d3f6 Refactor Assets/Scripts: trim restating comments, minor structure cleanups
Sweep over 48 files (Editor/ excluded): remove comments that restate the
code, condense class summaries, fix three stale doc statements
(HsvColorPicker alpha bar, PaintHud layoutPrefab, MasterVolume
FallbackDefault). Inline two single-use wrappers (IsPointerOverUi,
BuildModes), drop an unused using, replace a magic literal with the
existing ParallaxBase constant, and convert ~10 UnityEngine.Object null
checks to the implicit-bool convention. No serialized fields, signatures,
RPC/NetworkVariable names, defaults, or #if blocks touched.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-08 08:29:18 +02:00

21 lines
770 B
C#

using Unity.Netcode;
using UnityEngine;
/// <summary>
/// Per-avatar glue for a mid-match SPECTATOR. The spectator object is deliberately empty (no body,
/// renderer, collider or controller) - the free-fly camera is a separate, persistent scene object in
/// Main, so this only has to exist as the owner's player object and flip the local mode set to
/// free-cam-only; remote peers do nothing. MatchManager respawns it as a lobby Player at match end.
/// </summary>
[DisallowMultipleComponent]
public class SpectatorSetup : NetworkBehaviour
{
public override void OnNetworkSpawn()
{
if (!IsOwner) return;
var manager = FindFirstObjectByType<GameModeManager>(FindObjectsInactive.Include);
if (manager) manager.BindSpectator();
}
}