/// /// Insect / surface-walk mode: the player crawls along any surface (walls, ceilings, /// arbitrary slopes) via . The gravity-based /// is disabled so the two never fight. The /// camera keeps its world-up orbit; painting is off. /// public class InsectMode : GameMode { public override string DisplayName => "Insect"; public override void Enter() { if (Manager.Player) Manager.Player.enabled = false; // stop the gravity controller (its Update/gravity) if (Manager.Insect) { Manager.Insect.enabled = true; Manager.Insect.ControlEnabled = true; Manager.Insect.SnapToSurface(); } if (Manager.CameraInput) Manager.CameraInput.LookMode = ThirdPersonOrbitInput.OrbitLookMode.AlwaysActive; if (Manager.Painter) Manager.Painter.PaintingEnabled = false; } public override void Exit() { if (Manager.Insect) Manager.Insect.enabled = false; if (Manager.Player) Manager.Player.enabled = true; } }