[DesktopVRSwitch] - > DesktopXRSwitch

This commit is contained in:
NotAKidoS 2023-05-17 12:06:48 -05:00
parent 37fcf6ece1
commit 05374459be
21 changed files with 441 additions and 352 deletions

View file

@ -0,0 +1,24 @@
using ABI_RC.Core.Util.Object_Behaviour;
using UnityEngine;
namespace NAK.Melons.DesktopXRSwitch.Patches;
public class CameraFacingObjectTracker : MonoBehaviour
{
public CameraFacingObject cameraFacingObject;
void Start()
{
cameraFacingObject = GetComponent<CameraFacingObject>();
XRModeSwitchTracker.OnPostXRModeSwitch += PostXRModeSwitch;
}
void OnDestroy()
{
XRModeSwitchTracker.OnPostXRModeSwitch -= PostXRModeSwitch;
}
public void PostXRModeSwitch(bool isXR, Camera activeCamera)
{
cameraFacingObject.m_Camera = activeCamera;
}
}