backport from experimental

This commit is contained in:
NotAKidoS 2023-02-17 06:24:46 -06:00
parent 8a3523539b
commit 5fd8e3d4d6
14 changed files with 686 additions and 560 deletions

View file

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