Skip to content

Commit e00eb58

Browse files
committed
Fix RenderModelHook.overrideModel not working
1 parent 228e07c commit e00eb58

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Misc/RenderModelHook.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ protected void UpdateDefaultRenderModel(bool shouldActive)
103103

104104
var lastModelActivated = m_isModelActivated;
105105
var lastActivatedModel = m_activeModel;
106-
var shouldActiveModelNum = deviceState.deviceModel;
106+
var shouldActiveModelNum = hook.overrideModel == OverrideModelEnum.DontOverride ? deviceState.deviceModel : (VRModuleDeviceModel)hook.overrideModel;
107107
var shouldActiveModelPrefab = shouldActive ? GetDefaultDeviceModelPrefab(shouldActiveModelNum) : null;
108108
var shouldActiveModel = shouldActive && deviceState.isConnected && shouldActiveModelPrefab != null;
109109

@@ -229,11 +229,11 @@ public enum OverrideModelEnum
229229
ViveCosmosControllerRight = VRModuleDeviceModel.ViveCosmosControllerRight,
230230
OculusQuestControllerLeft = VRModuleDeviceModel.OculusQuestControllerLeft,
231231
OculusQuestControllerRight = VRModuleDeviceModel.OculusQuestControllerRight,
232-
IndexHMD = VRModuleDeviceModel.IndexHMD,
232+
IndexHMD = VRModuleDeviceModel.IndexHMD, // no model
233233
IndexControllerLeft = VRModuleDeviceModel.IndexControllerLeft,
234234
IndexControllerRight = VRModuleDeviceModel.IndexControllerRight,
235-
MagicLeapHMD = VRModuleDeviceModel.MagicLeapHMD,
236-
MagicLeapController = VRModuleDeviceModel.MagicLeapController,
235+
MagicLeapHMD = VRModuleDeviceModel.MagicLeapHMD, // no model
236+
MagicLeapController = VRModuleDeviceModel.MagicLeapController, // no model
237237
ViveHandTrackingTrackedHandLeft = VRModuleDeviceModel.ViveHandTrackingTrackedHandLeft,
238238
ViveHandTrackingTrackedHandRight = VRModuleDeviceModel.ViveHandTrackingTrackedHandRight,
239239
WaveLegacyTrackedHandLeft = VRModuleDeviceModel.WaveLegacyTrackedHandLeft,
@@ -242,6 +242,11 @@ public enum OverrideModelEnum
242242
WaveTrackedHandRight = VRModuleDeviceModel.WaveTrackedHandRight,
243243
OculusTrackedHandLeft = VRModuleDeviceModel.OculusTrackedHandLeft,
244244
OculusTrackedHandRight = VRModuleDeviceModel.OculusTrackedHandRight,
245+
ViveFocus3ControllerLeft = VRModuleDeviceModel.ViveFocus3ControllerLeft,
246+
ViveFocus3ControllerRight = VRModuleDeviceModel.ViveFocus3ControllerRight,
247+
ViveFocusChirp = VRModuleDeviceModel.ViveFocusChirp,
248+
ViveTracker3 = VRModuleDeviceModel.ViveTracker3,
249+
ViveFlowPhoneController = VRModuleDeviceModel.ViveFlowPhoneController,
245250
}
246251

247252
[SerializeField]

0 commit comments

Comments
 (0)