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>
21 lines
770 B
C#
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();
|
|
}
|
|
}
|