1010using UnityEngine . InputSystem . Controls ;
1111using UnityEngine . InputSystem . Layouts ;
1212using UnityEngine . InputSystem . LowLevel ;
13+ using UnityEngine . XR ;
14+
15+ using Usages = UnityEngine . InputSystem . CommonUsages ;
1316
1417using InputDeviceRole = UnityEngine . XR . InputDeviceRole ;
1518
@@ -20,10 +23,10 @@ internal class XRTests : InputTestFixture
2023 [ TestCase ( InputDeviceRole . Generic , "XRHMD" , typeof ( XRHMD ) ) ]
2124 [ TestCase ( InputDeviceRole . LeftHanded , "XRController" , typeof ( XRController ) ) ]
2225 [ TestCase ( InputDeviceRole . RightHanded , "XRController" , typeof ( XRController ) ) ]
23- [ TestCase ( InputDeviceRole . HardwareTracker , null , typeof ( InputDevice ) ) ]
24- [ TestCase ( InputDeviceRole . TrackingReference , null , typeof ( InputDevice ) ) ]
25- [ TestCase ( InputDeviceRole . GameController , null , typeof ( InputDevice ) ) ]
26- [ TestCase ( InputDeviceRole . Unknown , null , typeof ( InputDevice ) ) ]
26+ [ TestCase ( InputDeviceRole . HardwareTracker , null , typeof ( UnityEngine . InputSystem . InputDevice ) ) ]
27+ [ TestCase ( InputDeviceRole . TrackingReference , null , typeof ( UnityEngine . InputSystem . InputDevice ) ) ]
28+ [ TestCase ( InputDeviceRole . GameController , null , typeof ( UnityEngine . InputSystem . InputDevice ) ) ]
29+ [ TestCase ( InputDeviceRole . Unknown , null , typeof ( UnityEngine . InputSystem . InputDevice ) ) ]
2730 public void Devices_XRDeviceRoleDeterminesTypeOfDevice ( InputDeviceRole role , string baseLayoutName , Type expectedType )
2831 {
2932 var deviceDescription = CreateSimpleDeviceDescriptionByRole ( role ) ;
@@ -53,15 +56,15 @@ public void Devices_CanChangeHandednessOfXRController()
5356
5457 var controller = InputSystem . devices [ 0 ] ;
5558
56- Assert . That ( controller . usages , Has . Exactly ( 1 ) . EqualTo ( CommonUsages . LeftHand ) ) ;
57- Assert . That ( controller . usages , Has . Exactly ( 0 ) . EqualTo ( CommonUsages . RightHand ) ) ;
59+ Assert . That ( controller . usages , Has . Exactly ( 1 ) . EqualTo ( Usages . LeftHand ) ) ;
60+ Assert . That ( controller . usages , Has . Exactly ( 0 ) . EqualTo ( Usages . RightHand ) ) ;
5861 Assert . That ( XRController . rightHand , Is . Null ) ;
5962 Assert . That ( XRController . leftHand , Is . EqualTo ( controller ) ) ;
6063
61- InputSystem . SetDeviceUsage ( controller , CommonUsages . RightHand ) ;
64+ InputSystem . SetDeviceUsage ( controller , Usages . RightHand ) ;
6265
63- Assert . That ( controller . usages , Has . Exactly ( 0 ) . EqualTo ( CommonUsages . LeftHand ) ) ;
64- Assert . That ( controller . usages , Has . Exactly ( 1 ) . EqualTo ( CommonUsages . RightHand ) ) ;
66+ Assert . That ( controller . usages , Has . Exactly ( 0 ) . EqualTo ( Usages . LeftHand ) ) ;
67+ Assert . That ( controller . usages , Has . Exactly ( 1 ) . EqualTo ( Usages . RightHand ) ) ;
6568 Assert . That ( XRController . rightHand , Is . EqualTo ( controller ) ) ;
6669 Assert . That ( XRController . leftHand , Is . Null ) ;
6770 }
@@ -364,7 +367,7 @@ public void Layouts_ButtonsArePackedByTheByte_WhileLargerStructuresAreFourByteAl
364367 }
365368
366369 [ InputControlLayout ( updateBeforeRender = true ) ]
367- private class TestHMD : InputDevice
370+ private class TestHMD : UnityEngine . InputSystem . InputDevice
368371 {
369372 [ InputControl ]
370373 public QuaternionControl quaternion { get ; private set ; }
@@ -476,7 +479,7 @@ private static InputDeviceDescription CreateSimpleDeviceDescriptionByRole(InputD
476479 capabilities = new XRDeviceDescriptor
477480 {
478481#if ! UNITY_2019_3_OR_NEWER
479- InputDeviceRole = role ,
482+ deviceRole = role ,
480483#endif
481484 inputFeatures = new List < XRFeatureDescriptor > ( )
482485 {
@@ -500,7 +503,7 @@ private static InputDeviceDescription CreateMangledNameDeviceDescription()
500503 capabilities = new XRDeviceDescriptor
501504 {
502505#if ! UNITY_2019_3_OR_NEWER
503- deviceRole = DeviceRole . Generic ,
506+ deviceRole = InputDeviceRole . Generic ,
504507#endif
505508
506509 inputFeatures = new List < XRFeatureDescriptor > ( )
@@ -537,7 +540,7 @@ public static InputDeviceDescription CreateDeviceDescription()
537540 capabilities = new XRDeviceDescriptor
538541 {
539542#if ! UNITY_2019_3_OR_NEWER
540- deviceRole = DeviceRole . Generic ,
543+ deviceRole = InputDeviceRole . Generic ,
541544#endif
542545 inputFeatures = new List < XRFeatureDescriptor > ( )
543546 {
@@ -614,7 +617,7 @@ public static InputDeviceDescription CreateDeviceDescription()
614617 capabilities = new XRDeviceDescriptor
615618 {
616619#if ! UNITY_2019_3_OR_NEWER
617- deviceRole = DeviceRole . Generic ,
620+ deviceRole = InputDeviceRole . Generic ,
618621#endif
619622 inputFeatures = new List < XRFeatureDescriptor > ( )
620623 {
0 commit comments