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>
21 lines
637 B
C#
21 lines
637 B
C#
/// <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;
|
|
}
|
|
}
|