Add game mode manager with player-control and paint modes

Introduce an extensible game mode system toggled with Tab:
- Player Control: WASD movement with always-on mouse camera orbit
- Paint: player frozen, left-click paints, right-click holds to orbit

Add GameMode base class, GameModeManager, and the two concrete modes.
Refactor controlled scripts to expose clean state flags instead of
handling input themselves: ThirdPersonOrbitInput.LookMode,
PlayerCharacterController.ControlEnabled, MeshPainter.PaintingEnabled.

Also fix camera zoom: remove the obsolete /120 wheel normalization so
one scroll notch maps to one zoomSpeed step under the new Input System.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 4.8 committed 2026-06-22 15:13:46 +02:00
1 parent 6e8ab4bc6d
commit dcb1fc42a6
12 files changed
+358 -55

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
/// <summary>
/// Mode 1: the player walks with WASD/Space and the camera orbits freely with
/// the mouse (cursor locked/hidden). Mesh painting is disabled.
/// </summary>
public class PlayerControlMode : GameMode
{
public override string DisplayName => "Player Control";
public override void Enter()
{
if (Manager.Player != null)
Manager.Player.ControlEnabled = true;
if (Manager.CameraInput != null)
Manager.CameraInput.LookMode = ThirdPersonOrbitInput.OrbitLookMode.AlwaysActive;
if (Manager.Painter != null)
Manager.Painter.PaintingEnabled = false;
}
}