mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-03 06:49:22 +00:00
[DesktopVRSwitch] Testing
This commit is contained in:
parent
03514305be
commit
61a45f97bc
30 changed files with 957 additions and 524 deletions
|
@ -0,0 +1,29 @@
|
|||
using ABI_RC.Core.InteractionSystem;
|
||||
|
||||
namespace NAK.DesktopVRSwitch.VRModeTrackers;
|
||||
|
||||
public class CVR_InteractableManagerTracker : VRModeTracker
|
||||
{
|
||||
public override void TrackerInit()
|
||||
{
|
||||
VRModeSwitchManager.OnPostVRModeSwitch += OnPostSwitch;
|
||||
}
|
||||
|
||||
public override void TrackerDestroy()
|
||||
{
|
||||
VRModeSwitchManager.OnPostVRModeSwitch -= OnPostSwitch;
|
||||
}
|
||||
|
||||
private void OnPostSwitch(bool intoVR)
|
||||
{
|
||||
CVR_InteractableManager _cvrInteractableManager = CVR_InteractableManager.Instance;
|
||||
if (_cvrInteractableManager == null)
|
||||
{
|
||||
DesktopVRSwitch.Logger.Error("Error while getting CVR_InteractableManager!");
|
||||
return;
|
||||
}
|
||||
DesktopVRSwitch.Logger.Msg($"Setting CVRInputManager inputEnabled & CVR_InteractableManager enableInteractions to {!intoVR}");
|
||||
|
||||
CVR_InteractableManager.enableInteractions = !intoVR;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue