Files
chameleon/Assets/Scripts/GameMode/FreeCamMode.cs
T
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

31 lines
1.0 KiB
C#

/// <summary>
/// Free-fly camera mode. The player is frozen and painting is off while a dedicated freecam
/// (<see cref="FreeCamController"/> + its own CinemachineCamera) flies through the map, colliding
/// with world geometry. Orbit camera input is disabled so it doesn't fight for the cursor.
/// </summary>
public class FreeCamMode : GameMode
{
public override string DisplayName => "Free Cam";
public override void Enter()
{
// Keep the player component alive (gravity/grounding) but reject input, like Paint mode.
SetPlayerControl(false);
SetPainting(false);
SetOrbitInputEnabled(false);
if (Manager.FreeCam)
Manager.FreeCam.SetActive(true);
}
public override void Exit()
{
// Modes are Enter-only, so freecam must undo its own camera takeover here; the next mode's
// Enter restores the player/painter/look-mode state.
if (Manager.FreeCam)
Manager.FreeCam.SetActive(false);
SetOrbitInputEnabled(true);
}
}