restored from pc, added .editorconfig
This commit is contained in:
13
Assets/jelycho/Code/Player/PlayerController.cs
Normal file → Executable file
13
Assets/jelycho/Code/Player/PlayerController.cs
Normal file → Executable file
@@ -17,8 +17,6 @@ namespace RealityReboot.jelycho.Player {
|
||||
readonly Config m_Config;
|
||||
PlayerActor m_FPPActor;
|
||||
|
||||
[Inject] InputService m_InputService;
|
||||
|
||||
public PlayerController(Config config) {
|
||||
m_Config = config;
|
||||
}
|
||||
@@ -27,8 +25,8 @@ namespace RealityReboot.jelycho.Player {
|
||||
}
|
||||
|
||||
public async UniTask OnStart(CancellationToken cancellationToken) {
|
||||
m_InputService.LockCursor();
|
||||
m_InputService.EnableControls();
|
||||
RR.Input.LockCursor();
|
||||
RR.Input.EnableControls();
|
||||
|
||||
m_FPPActor = await RR.World.SpawnActor<PlayerActor>(m_Config.playerActorPrefab, cancellationToken);
|
||||
m_FPPActor.Simulate = true;
|
||||
@@ -37,8 +35,8 @@ namespace RealityReboot.jelycho.Player {
|
||||
}
|
||||
|
||||
public void OnStop() {
|
||||
m_InputService.DisableControls();
|
||||
m_InputService.UnlockCursor();
|
||||
RR.Input.DisableControls();
|
||||
RR.Input.UnlockCursor();
|
||||
Object.Destroy(m_FPPActor);
|
||||
|
||||
RR.World.KillActor(m_FPPActor);
|
||||
@@ -57,8 +55,7 @@ namespace RealityReboot.jelycho.Player {
|
||||
m_FPPActor.Look(lookInput * FPPConfig.s_MouseSensitivity.FloatValue);
|
||||
|
||||
Vector2 moveInput = m_Config.moveActionReference.action.ReadValue<Vector2>();
|
||||
m_FPPActor.MoveRight(moveInput.x);
|
||||
m_FPPActor.MoveForward(moveInput.y);
|
||||
m_FPPActor.SetMoveInput(moveInput);
|
||||
|
||||
if (m_Config.jumpActionReference.action.WasPerformedThisFrame()) {
|
||||
m_FPPActor.Jump();
|
||||
|
||||
Reference in New Issue
Block a user