[DesktopVRSwitch] Testing

This commit is contained in:
NotAKidoS 2023-06-19 19:44:23 -05:00
parent 03514305be
commit 61a45f97bc
30 changed files with 957 additions and 524 deletions

View file

@ -0,0 +1,30 @@
using ABI_RC.Core.Savior;
using UnityEngine;
namespace NAK.DesktopVRSwitch.VRModeTrackers;
public class CVRGestureRecognizerTracker : VRModeTracker
{
public override void TrackerInit()
{
VRModeSwitchManager.OnPostVRModeSwitch += OnPostSwitch;
}
public override void TrackerDestroy()
{
VRModeSwitchManager.OnPostVRModeSwitch -= OnPostSwitch;
}
private void OnPostSwitch(bool intoVR)
{
CVRGestureRecognizer _cvrGestureRecognizer = CVRGestureRecognizer.Instance;
if (_cvrGestureRecognizer == null)
{
DesktopVRSwitch.Logger.Error("Error while getting CVRGestureRecognizer!");
return;
}
DesktopVRSwitch.Logger.Msg("Updating CVRGestureRecognizer _camera to active camera.");
_cvrGestureRecognizer._camera = Utils.GetPlayerCameraObject(intoVR).GetComponent<Camera>();
}
}