mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 14:29:25 +00:00
TrackedControllerFix must do stuff in Awake so SmoothRay can handle the SteamVRTrackedObject in Start.
16 lines
No EOL
557 B
C#
16 lines
No EOL
557 B
C#
using ABI_RC.Core.Player;
|
|
using HarmonyLib;
|
|
using Valve.VR;
|
|
|
|
namespace NAK.TrackedControllerFix.HarmonyPatches;
|
|
|
|
class PlayerSetupPatches
|
|
{
|
|
[HarmonyPostfix]
|
|
[HarmonyPatch(typeof(PlayerSetup), nameof(PlayerSetup.Start))]
|
|
static void Post_PlayerSetup_Start(ref PlayerSetup __instance)
|
|
{
|
|
__instance.vrLeftHandTracker.AddComponent<TrackedControllerFixer>().inputSource = SteamVR_Input_Sources.LeftHand;
|
|
__instance.vrRightHandTracker.AddComponent<TrackedControllerFixer>().inputSource = SteamVR_Input_Sources.RightHand;
|
|
}
|
|
} |