[TrackedControllerFix] Needed changes for SmoothRay Support

This commit is contained in:
NotAKidoS 2023-05-21 23:04:17 -05:00
parent ea9ebf374b
commit b5df421bec
2 changed files with 17 additions and 13 deletions

View file

@ -4,16 +4,18 @@ using Valve.VR;
namespace NAK.TrackedControllerFix.HarmonyPatches;
internal class PlayerSetupPatches
class PlayerSetupPatches
{
[HarmonyPostfix]
[HarmonyPatch(typeof(PlayerSetup), "Start")]
private static void Post_PlayerSetup_Start(ref PlayerSetup __instance)
[HarmonyPatch(typeof(PlayerSetup), nameof(PlayerSetup.Start))]
static void Post_PlayerSetup_Start(ref PlayerSetup __instance)
{
// Add TrackedControllerFix
var vrLeftHandTracker = __instance.vrLeftHandTracker.AddComponent<TrackedControllerFixer>();
vrLeftHandTracker.inputSource = SteamVR_Input_Sources.LeftHand;
var vrRightHandTracker = __instance.vrRightHandTracker.AddComponent<TrackedControllerFixer>();
vrRightHandTracker.inputSource = SteamVR_Input_Sources.RightHand;
vrLeftHandTracker.Initialize();
vrRightHandTracker.Initialize();
}
}