mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 22:39:22 +00:00
[DesktopVRSwitch] Testing
This commit is contained in:
parent
03514305be
commit
61a45f97bc
30 changed files with 957 additions and 524 deletions
41
DesktopVRSwitch/VRModeTrackers/CVRInputManagerTracker.cs
Normal file
41
DesktopVRSwitch/VRModeTrackers/CVRInputManagerTracker.cs
Normal file
|
@ -0,0 +1,41 @@
|
|||
using ABI_RC.Core.Savior;
|
||||
|
||||
namespace NAK.DesktopVRSwitch.VRModeTrackers;
|
||||
|
||||
public class CVRInputManagerTracker : VRModeTracker
|
||||
{
|
||||
public override void TrackerInit()
|
||||
{
|
||||
VRModeSwitchManager.OnPostVRModeSwitch += OnPostSwitch;
|
||||
}
|
||||
|
||||
public override void TrackerDestroy()
|
||||
{
|
||||
VRModeSwitchManager.OnPostVRModeSwitch -= OnPostSwitch;
|
||||
}
|
||||
|
||||
void OnPostSwitch(bool intoVR)
|
||||
{
|
||||
CVRInputManager _cvrInputManager = CVRInputManager.Instance;
|
||||
if (_cvrInputManager == null)
|
||||
{
|
||||
DesktopVRSwitch.Logger.Error("Error while getting CVRInputManager!");
|
||||
return;
|
||||
}
|
||||
DesktopVRSwitch.Logger.Msg("Resetting CVRInputManager inputs.");
|
||||
|
||||
_cvrInputManager.inputEnabled = true;
|
||||
|
||||
//just in case
|
||||
_cvrInputManager.blockedByUi = false;
|
||||
//sometimes head can get stuck, so just in case
|
||||
_cvrInputManager.independentHeadToggle = false;
|
||||
//just nice to load into desktop with idle gesture
|
||||
_cvrInputManager.gestureLeft = 0f;
|
||||
_cvrInputManager.gestureLeftRaw = 0f;
|
||||
_cvrInputManager.gestureRight = 0f;
|
||||
_cvrInputManager.gestureRightRaw = 0f;
|
||||
//turn off finger tracking input
|
||||
_cvrInputManager.individualFingerTracking = false;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue