Add InsectController (transform-driven SphereCast surface following, no CharacterController/Rigidbody, no gravity or slope limit) and InsectMode as a third game mode. Wire it into GameModeManager with conditional registration so PlayerControl and Insect modes only join the Tab cycle when their controller is present. PaintMode/PlayerControlMode toggle the insect controller accordingly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
27 lines
706 B
C#
27 lines
706 B
C#
/// <summary>
|
|
/// Player walks with WASD/Space, the camera orbits freely with the mouse.
|
|
/// Painting is disabled.
|
|
/// </summary>
|
|
public class PlayerControlMode : GameMode
|
|
{
|
|
public override string DisplayName => "Player Control";
|
|
|
|
public override void Enter()
|
|
{
|
|
if (Manager.Insect)
|
|
Manager.Insect.enabled = false;
|
|
|
|
if (Manager.Player)
|
|
{
|
|
Manager.Player.enabled = true;
|
|
Manager.Player.ControlEnabled = true;
|
|
}
|
|
|
|
if (Manager.CameraInput)
|
|
Manager.CameraInput.LookMode = ThirdPersonOrbitInput.OrbitLookMode.AlwaysActive;
|
|
|
|
if (Manager.Painter)
|
|
Manager.Painter.PaintingEnabled = false;
|
|
}
|
|
}
|