mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-06 08:19:23 +00:00
[DesktopVRSwitch] - > DesktopXRSwitch
This commit is contained in:
parent
37fcf6ece1
commit
05374459be
21 changed files with 441 additions and 352 deletions
|
@ -1,31 +0,0 @@
|
|||
using ABI.CCK.Components;
|
||||
using UnityEngine;
|
||||
|
||||
//Thanks Ben! I was scared of transpiler so I reworked a bit...
|
||||
|
||||
namespace NAK.DesktopVRSwitch.Patches;
|
||||
|
||||
public class CVRPickupObjectTracker : MonoBehaviour
|
||||
{
|
||||
public CVRPickupObject pickupObject;
|
||||
public Transform storedGripOrigin;
|
||||
|
||||
void Start()
|
||||
{
|
||||
VRModeSwitchTracker.OnPostVRModeSwitch += PostVRModeSwitch;
|
||||
}
|
||||
|
||||
void OnDestroy()
|
||||
{
|
||||
VRModeSwitchTracker.OnPostVRModeSwitch -= PostVRModeSwitch;
|
||||
}
|
||||
|
||||
public void PostVRModeSwitch(bool enableVR, Camera activeCamera)
|
||||
{
|
||||
if (pickupObject != null)
|
||||
{
|
||||
if (pickupObject._controllerRay != null) pickupObject._controllerRay.DropObject(true);
|
||||
(storedGripOrigin, pickupObject.gripOrigin) = (pickupObject.gripOrigin, storedGripOrigin);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue