mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-03 06:49:22 +00:00
[DesktopVRSwitch] Nuke CohtmlUISystem Gamepad handling for now.
This commit is contained in:
parent
5f95755ad2
commit
0fb7c3d401
19 changed files with 146 additions and 21 deletions
|
@ -1,4 +1,5 @@
|
|||
using ABI_RC.Systems.MovementSystem;
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
namespace NAK.DesktopVRSwitch.VRModeTrackers;
|
||||
|
@ -12,12 +13,14 @@ public class MovementSystemTracker : VRModeTracker
|
|||
public override void TrackerInit()
|
||||
{
|
||||
VRModeSwitchManager.OnPreVRModeSwitch += OnPreSwitch;
|
||||
VRModeSwitchManager.OnFailVRModeSwitch += OnFailedSwitch;
|
||||
VRModeSwitchManager.OnPostVRModeSwitch += OnPostSwitch;
|
||||
}
|
||||
|
||||
public override void TrackerDestroy()
|
||||
{
|
||||
VRModeSwitchManager.OnPreVRModeSwitch -= OnPreSwitch;
|
||||
VRModeSwitchManager.OnFailVRModeSwitch -= OnFailedSwitch;
|
||||
VRModeSwitchManager.OnPostVRModeSwitch -= OnPostSwitch;
|
||||
}
|
||||
|
||||
|
@ -28,10 +31,16 @@ public class MovementSystemTracker : VRModeTracker
|
|||
preSwitchWorldPosition = Utils.GetPlayerRootPosition();
|
||||
preSwitchWorldRotation = _movementSystem.rotationPivot.transform.rotation;
|
||||
|
||||
_movementSystem.SetImmobilized(true);
|
||||
_movementSystem.ChangeCrouch(false);
|
||||
_movementSystem.ChangeProne(false);
|
||||
}
|
||||
|
||||
private void OnFailedSwitch(bool intoVR)
|
||||
{
|
||||
_movementSystem.SetImmobilized(false);
|
||||
}
|
||||
|
||||
private void OnPostSwitch(bool intoVR)
|
||||
{
|
||||
_movementSystem.rotationPivot = Utils.GetPlayerCameraObject(intoVR).transform;
|
||||
|
@ -40,6 +49,7 @@ public class MovementSystemTracker : VRModeTracker
|
|||
if (!intoVR)
|
||||
_movementSystem.UpdateColliderCenter(_movementSystem.transform.position);
|
||||
|
||||
_movementSystem.SetImmobilized(false);
|
||||
_movementSystem.ChangeCrouch(false);
|
||||
_movementSystem.ChangeProne(false);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue