This commit is contained in:
2025-03-15 12:33:50 +01:00
parent 0d3516774e
commit 569b1d00b3
28 changed files with 446 additions and 147 deletions

View File

@@ -21,14 +21,19 @@ namespace RebootKit.FPPKit {
public InputActionReference PrimaryActionReference;
public InputActionReference SecondaryActionReference;
}
[CVar("fpp_cam_look_sens", 0.25f)]
private CVar _sensitivityCVar;
[CVar("p_move_speed", 4.0f)]
private CVar _movementSpeedCVar;
[Inject]
private InputService _inputService;
private Config _config;
private FPPActor _player;
private CVar _sensitivityCVar;
private CVar _movementSpeedCVar;
public PlayerController(Config config) {
_config = config;
}
@@ -37,8 +42,8 @@ namespace RebootKit.FPPKit {
}
public async UniTask OnStart(CancellationToken cancellationToken) {
RR.Service<InputService>().LockCursor();
RR.Service<InputService>().EnableControls();
_inputService.LockCursor();
_inputService.EnableControls();
_sensitivityCVar = RR.CVarNumber("fpp_cam_look_sens", 0.25f);
_movementSpeedCVar = RR.CVarNumber("p_move_speed", 4.0f);
@@ -49,8 +54,8 @@ namespace RebootKit.FPPKit {
}
public void OnStop() {
RR.Service<InputService>().DisableControls();
RR.Service<InputService>().UnlockCursor();
_inputService.DisableControls();
_inputService.UnlockCursor();
Object.Destroy(_player);
RR.World().KillActor(_player);