Skip to content

Commit c7f5388

Browse files
author
lawwong
committed
Add recognizing Focus 3 controller for more cases
1 parent 124b355 commit c7f5388

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Assets/HTC.UnityPlugin/VRModule/VRModuleBase.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ protected enum DefaultModuleOrder
3636

3737
private static readonly Regex s_viveRgx = new Regex("^.*(vive|htc).*$", REGEX_OPTIONS);
3838
private static readonly Regex s_viveCosmosRgx = new Regex("^.*(cosmos).*$", REGEX_OPTIONS);
39+
private static readonly Regex s_focus3Rgx = new Regex("focus3", REGEX_OPTIONS);
3940
private static readonly Regex s_ver3Rgx = new Regex("^.*3.0.*$", REGEX_OPTIONS);
4041
private static readonly Regex s_oculusRgx = new Regex("^.*(oculus|quest).*$", REGEX_OPTIONS);
4142
private static readonly Regex s_indexRgx = new Regex("^.*(index|knuckles).*$", REGEX_OPTIONS);
@@ -187,6 +188,18 @@ protected static void SetupKnownDeviceModel(IVRModuleDeviceStateRW deviceState)
187188
}
188189
deviceState.input2DType = VRModuleInput2DType.JoystickOnly;
189190
}
191+
else if (s_focus3Rgx.IsMatch(deviceState.modelNumber))
192+
{
193+
if (s_leftRgx.IsMatch(deviceState.modelNumber))
194+
{
195+
deviceState.deviceModel = VRModuleDeviceModel.ViveFocus3ControllerLeft;
196+
}
197+
else if (s_rightRgx.IsMatch(deviceState.modelNumber))
198+
{
199+
deviceState.deviceModel = VRModuleDeviceModel.ViveFocus3ControllerRight;
200+
}
201+
deviceState.input2DType = VRModuleInput2DType.JoystickOnly;
202+
}
190203
else
191204
{
192205
deviceState.deviceModel = VRModuleDeviceModel.ViveController;

0 commit comments

Comments
 (0)