Skip to content

Commit 8d4df7e

Browse files
author
lawwong
committed
Fix IMap.UnbindAll() no working correctly
Device that bound to Invalid role won't unbind previously.
1 parent fd1f63d commit 8d4df7e

File tree

1 file changed

+2
-2
lines changed
  • Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/ViveRole

1 file changed

+2
-2
lines changed

Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/ViveRole/ViveRoleMap.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,9 +559,9 @@ public bool UnbindConnectedDevice(uint deviceIndex)
559559

560560
public void UnbindAll()
561561
{
562-
for (var roleValue = m_info.MinValidRoleValue; roleValue <= m_info.MaxValidRoleValue; ++roleValue)
562+
for (int i = m_sn2role.Count - 1; i >= 0; --i)
563563
{
564-
UnbindRoleValue(roleValue);
564+
UnbindDevice(m_sn2role.GetKeyByIndex(i));
565565
}
566566
}
567567

0 commit comments

Comments
 (0)