mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-06 00:09:22 +00:00
[DesktopVRSwitch] - > DesktopXRSwitch
This commit is contained in:
parent
37fcf6ece1
commit
05374459be
21 changed files with 441 additions and 352 deletions
24
DesktopXRSwitch/Patches/CameraFacingObjectTracker.cs
Normal file
24
DesktopXRSwitch/Patches/CameraFacingObjectTracker.cs
Normal 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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue