Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Commit

Permalink
fix supported contollers not showing battery
Browse files Browse the repository at this point in the history
  • Loading branch information
galister committed Jan 28, 2023
1 parent 3d91683 commit 2240b5e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Core/InputManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,14 @@ public void UpdateDeviceStates()
continue;

var nativeRole = OpenVR.System.GetControllerRoleForTrackedDeviceIndex(_deviceIds[i]);
if (nativeRole != ETrackedControllerRole.LeftHand && nativeRole != ETrackedControllerRole.RightHand)
if (nativeRole is ETrackedControllerRole.LeftHand or ETrackedControllerRole.RightHand)
{
var controllerIdx = nativeRole - ETrackedControllerRole.LeftHand;
device.Role = TrackedDeviceRole.LeftHand + controllerIdx;
_controllers[controllerIdx] = device;
}
else
device.Role = TrackedDeviceRole.None;
else
_controllers[nativeRole - ETrackedControllerRole.LeftHand] = device;

DeviceStates[device.Serial] = device;
}
Expand Down

0 comments on commit 2240b5e

Please sign in to comment.