mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 22:39:22 +00:00
backport
This commit is contained in:
parent
8a3523539b
commit
1e636e3395
13 changed files with 732 additions and 5 deletions
|
@ -1,11 +1,15 @@
|
|||
using ABI.CCK.Components;
|
||||
<<<<<<< Updated upstream
|
||||
using ABI_RC.Core.Savior;
|
||||
using HarmonyLib;
|
||||
using MelonLoader;
|
||||
=======
|
||||
>>>>>>> Stashed changes
|
||||
using UnityEngine;
|
||||
|
||||
//Thanks Ben! I was scared of transpiler so I reworked a bit...
|
||||
|
||||
<<<<<<< Updated upstream
|
||||
namespace DesktopVRSwitch.Patches;
|
||||
|
||||
[HarmonyPatch]
|
||||
|
@ -59,3 +63,31 @@ public class CVRPickupObjectTracker : MonoBehaviour
|
|||
previousGripOrigin.Remove(pickupObject);
|
||||
}
|
||||
}
|
||||
=======
|
||||
namespace NAK.Melons.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 enterXR, Camera activeCamera)
|
||||
{
|
||||
if (pickupObject != null)
|
||||
{
|
||||
if (pickupObject._controllerRay != null) pickupObject._controllerRay.DropObject(true);
|
||||
(storedGripOrigin, pickupObject.gripOrigin) = (pickupObject.gripOrigin, storedGripOrigin);
|
||||
}
|
||||
}
|
||||
}
|
||||
>>>>>>> Stashed changes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue