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>
22 lines
711 B
C#
22 lines
711 B
C#
/// <summary>
|
|
/// Mode 2: the player stands still and the mesh is painted with the left mouse
|
|
/// button. The camera orbits only while the right mouse button is held, so
|
|
/// dragging with the left button paints instead of rotating the view.
|
|
/// </summary>
|
|
public class PaintMode : GameMode
|
|
{
|
|
public override string DisplayName => "Paint";
|
|
|
|
public override void Enter()
|
|
{
|
|
if (Manager.Player != null)
|
|
Manager.Player.ControlEnabled = false;
|
|
|
|
if (Manager.CameraInput != null)
|
|
Manager.CameraInput.LookMode = ThirdPersonOrbitInput.OrbitLookMode.HoldRightMouseButton;
|
|
|
|
if (Manager.Painter != null)
|
|
Manager.Painter.PaintingEnabled = true;
|
|
}
|
|
}
|