mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-04 07:19:22 +00:00
[DesktopVRSwitch] Testing
This commit is contained in:
parent
03514305be
commit
61a45f97bc
30 changed files with 957 additions and 524 deletions
31
DesktopVRSwitch/VRModeTrackers/PortableCameraTracker.cs
Normal file
31
DesktopVRSwitch/VRModeTrackers/PortableCameraTracker.cs
Normal file
|
@ -0,0 +1,31 @@
|
|||
using ABI_RC.Systems.Camera;
|
||||
|
||||
namespace NAK.DesktopVRSwitch.VRModeTrackers;
|
||||
|
||||
public class PortableCameraTracker : VRModeTracker
|
||||
{
|
||||
public override void TrackerInit()
|
||||
{
|
||||
VRModeSwitchManager.OnPostVRModeSwitch += OnPostSwitch;
|
||||
}
|
||||
|
||||
public override void TrackerDestroy()
|
||||
{
|
||||
VRModeSwitchManager.OnPostVRModeSwitch -= OnPostSwitch;
|
||||
}
|
||||
|
||||
private void OnPostSwitch(bool intoVR)
|
||||
{
|
||||
PortableCamera _portableCamera = PortableCamera.Instance;
|
||||
if (_portableCamera == null)
|
||||
{
|
||||
DesktopVRSwitch.Logger.Error("Error while getting PortableCamera!");
|
||||
return;
|
||||
}
|
||||
DesktopVRSwitch.Logger.Msg("Forcing PortableCamera canvas mirroring off.");
|
||||
|
||||
// Tell the game we are in mirror mode so it'll disable it (if enabled)
|
||||
_portableCamera.mode = MirroringMode.Mirror;
|
||||
_portableCamera.ChangeMirroring();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue