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:
1 parent
6e8ab4bc6d
commit
dcb1fc42a6
12 files changed
+358
-55
No files matched your search
@@ -0,0 +1,21 @@
|
||||
/// <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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user