@@ -131,9 +131,10 @@ private static int CompareRoleIdx(RoleIdx a, RoleIdx b)
131131 private static string shortIdx ( uint i ) { return i == INVALID_DEVICE_INDEX ? "X" : i . ToString ( ) ; }
132132
133133 private VRModule . SubmoduleBase . Collection submodules = new VRModule . SubmoduleBase . Collection (
134- new ViveHandTrackingSubmodule ( ) ,
135- new WaveHandTrackingSubmodule ( ) ,
136- new WaveTrackerSubmodule ( )
134+ new ViveHandTrackingSubmodule ( )
135+ , new WaveHandTrackingSubmodule ( )
136+ , new WaveTrackerSubmodule ( )
137+ , new UnityXRHandSubmodule ( )
137138 ) ;
138139
139140 private bool [ ] prevDeviceConnected = new bool [ VRModule . MAX_DEVICE_COUNT ] ;
@@ -160,11 +161,12 @@ public override void OnActivated()
160161 EnsureDeviceStateLength ( 8 ) ;
161162 UpdateTrackingSpaceType ( ) ;
162163 submodules . ActivateAllModules ( ) ;
163- Debug . Log ( "Activated XRLoader Name: " + XRGeneralSettings . Instance . Manager . activeLoader . name ) ;
164+ Debug . Log ( "[UnityXRModule] OnActivated XRLoader Name: " + XRGeneralSettings . Instance . Manager . activeLoader . name ) ;
164165 }
165166
166167 public override void OnDeactivated ( )
167168 {
169+ Debug . Log ( "[UnityXRModule] OnDeactivated" ) ;
168170 submodules . DeactivateAllModules ( ) ;
169171 indexMap . Clear ( ) ;
170172 }
@@ -208,7 +210,6 @@ public sealed override void BeforeRenderUpdate()
208210 if ( ! indexMap . TryGetIndex ( device , out deviceIndex ) )
209211 {
210212 string deviceName ;
211-
212213 if ( indexMap . TryMapAsHMD ( device ) )
213214 {
214215 deviceIndex = VRModule . HMD_DEVICE_INDEX ;
@@ -272,27 +273,28 @@ public sealed override void BeforeRenderUpdate()
272273 if ( ( device . characteristics & InputDeviceCharacteristics . Right ) != 0u ) { rightIndice . Add ( new RoleIdx ( currState ) ) ; }
273274 else if ( ( device . characteristics & InputDeviceCharacteristics . Left ) != 0u ) { leftIndice . Add ( new RoleIdx ( currState ) ) ; }
274275 }
275-
276276 // TODO: update hand skeleton pose
277277 }
278278
279279 // unmap index for disconnected device state
280- for ( uint i = 0u , imax = ( uint ) prevMaxConnectedIndex ; i <= imax ; ++ i )
280+ for ( int i = 0 , imax = prevMaxConnectedIndex ; i <= imax ; ++ i )
281281 {
282282 if ( prevDeviceConnected [ i ] && ! currDeviceConnected [ i ] )
283283 {
284- if ( indexMap . IsMapped ( i ) )
284+ if ( indexMap . IsMapped ( ( uint ) i ) )
285285 {
286- indexMap . UnmapByIndex ( i ) ;
286+ indexMap . UnmapByIndex ( ( uint ) i ) ;
287+ //Debug.Log("[UnityXRModule] unmap [" + i + "]");
287288 }
288289 else
289290 {
290291 Debug . LogWarning ( "[UnityXRModule] unmap failed: [" + i + "] already unmapped" ) ;
291292 }
292293
293- if ( TryGetValidDeviceState ( i , out prevState , out currState ) && currState . isConnected )
294+ if ( TryGetValidDeviceState ( ( uint ) i , out prevState , out currState ) && currState . isConnected )
294295 {
295296 currState . Reset ( ) ;
297+ //Debug.Log("[UnityXRModule] reset [" + i + "]");
296298 }
297299 else
298300 {
@@ -410,6 +412,11 @@ protected static VRModuleDeviceClass GetDeviceClass(string name, InputDeviceChar
410412 return VRModuleDeviceClass . TrackingReference ;
411413 }
412414
415+ if ( ( characteristics & InputDeviceCharacteristics . HandTracking ) != 0 )
416+ {
417+ return VRModuleDeviceClass . Invalid ;
418+ }
419+
413420 if ( ( characteristics & InputDeviceCharacteristics . TrackedDevice ) != 0 )
414421 {
415422 return VRModuleDeviceClass . GenericTracker ;
0 commit comments