mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-01 05:49:23 +00:00
[TrackedControllerFix] Slight cleanup for consistancy with SmoothRay.
TrackedControllerFix must do stuff in Awake so SmoothRay can handle the SteamVRTrackedObject in Start.
This commit is contained in:
parent
36b1323996
commit
62c5eec71a
2 changed files with 4 additions and 10 deletions
|
@ -10,11 +10,7 @@ class PlayerSetupPatches
|
|||
[HarmonyPatch(typeof(PlayerSetup), nameof(PlayerSetup.Start))]
|
||||
static void Post_PlayerSetup_Start(ref PlayerSetup __instance)
|
||||
{
|
||||
var leftFixer = __instance.vrLeftHandTracker.AddComponent<TrackedControllerFixer>();
|
||||
leftFixer.inputSource = SteamVR_Input_Sources.LeftHand;
|
||||
leftFixer.Initialize();
|
||||
var rightFixer = __instance.vrRightHandTracker.AddComponent<TrackedControllerFixer>();
|
||||
rightFixer.inputSource = SteamVR_Input_Sources.RightHand;
|
||||
rightFixer.Initialize();
|
||||
__instance.vrLeftHandTracker.AddComponent<TrackedControllerFixer>().inputSource = SteamVR_Input_Sources.LeftHand;
|
||||
__instance.vrRightHandTracker.AddComponent<TrackedControllerFixer>().inputSource = SteamVR_Input_Sources.RightHand;
|
||||
}
|
||||
}
|
|
@ -11,10 +11,10 @@ public class TrackedControllerFixer : MonoBehaviour
|
|||
SteamVR_TrackedObject trackedObject;
|
||||
SteamVR_Behaviour_Pose oldBehaviourPose;
|
||||
SteamVR_Action_Pose actionPose;
|
||||
|
||||
|
||||
SteamVR_RenderModel renderModel;
|
||||
|
||||
public void Initialize()
|
||||
void Awake()
|
||||
{
|
||||
trackedObject = gameObject.AddComponent<SteamVR_TrackedObject>();
|
||||
oldBehaviourPose = gameObject.GetComponent<SteamVR_Behaviour_Pose>();
|
||||
|
@ -46,9 +46,7 @@ public class TrackedControllerFixer : MonoBehaviour
|
|||
void Update()
|
||||
{
|
||||
if (deviceIndex < 0)
|
||||
{
|
||||
CheckDeviceIndex();
|
||||
}
|
||||
}
|
||||
|
||||
void OnDeviceConnectedChanged(SteamVR_Action_Pose changedAction, SteamVR_Input_Sources changedSource, bool connected)
|
Loading…
Add table
Add a link
Reference in a new issue