mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 22:39:22 +00:00
24 lines
No EOL
568 B
C#
24 lines
No EOL
568 B
C#
using ABI_RC.Core.Util.Object_Behaviour;
|
|
using UnityEngine;
|
|
|
|
namespace NAK.DesktopVRSwitch.VRModeTrackers;
|
|
|
|
public class CameraFacingObjectTracker : MonoBehaviour
|
|
{
|
|
internal CameraFacingObject _cameraFacingObject;
|
|
|
|
void Start()
|
|
{
|
|
VRModeSwitchManager.OnPostVRModeSwitch += OnPostSwitch;
|
|
}
|
|
|
|
void OnDestroy()
|
|
{
|
|
VRModeSwitchManager.OnPostVRModeSwitch -= OnPostSwitch;
|
|
}
|
|
|
|
public void OnPostSwitch(bool intoVR)
|
|
{
|
|
_cameraFacingObject.m_Camera = Utils.GetPlayerCameraObject(intoVR).GetComponent<Camera>();
|
|
}
|
|
} |