@@ -309,7 +309,24 @@ public override void OnPreferenceGUI()
309309 EditorGUILayout . BeginHorizontal ( ) ;
310310#if VIU_WAVEVR_HAND_TRACKING_CHECK && VIU_WAVEVR_HAND_TRACKING
311311 {
312- var supported = EditorPrefs . GetBool ( "Wave/HandTracking/EnableHandTracking" , false ) && VRModuleSettings . activateWaveHandTrackingSubmodule ;
312+ #if VIU_WAVE_NATIVE_5_0_OR_NEWER
313+ Wave . XR . Settings . WaveXRSettings settings = Wave . XR . Settings . WaveXRSettings . GetInstance ( ) ;
314+ if ( settings != null )
315+ {
316+ var supported = settings . EnableNaturalHand && VRModuleSettings . activateWaveHandTrackingSubmodule ;
317+ var shouldSupport = EditorGUILayout . ToggleLeft ( new GUIContent ( enableWaveHandTrackingTitle ) , supported ) ;
318+ if ( supported != shouldSupport )
319+ {
320+ settings . EnableNaturalHand = shouldSupport ;
321+ VRModuleSettings . activateWaveHandTrackingSubmodule = shouldSupport ;
322+ // can manually disable gesture data fetching by setting enableWaveHandGesture to false if needed
323+ // so far the hardware/runtime will start gesture detaction whenever hand tracking detaction is started,
324+ // disabling enableWaveHandGesture only save some data fetching time, it doesn't stop hardware/runtime gesture detaction
325+ if ( shouldSupport ) { VRModuleSettings . enableWaveHandGesture = true ; }
326+ }
327+ }
328+ #else
329+ var supported = EditorPrefs . GetBool ( "Wave/Hand Tracking/Enable Hand Tracking" , false ) && VRModuleSettings . activateWaveHandTrackingSubmodule ;
313330 var shouldSupport = EditorGUILayout . ToggleLeft ( new GUIContent ( enableWaveHandTrackingTitle ) , supported ) ;
314331 if ( supported != shouldSupport )
315332 {
@@ -320,6 +337,7 @@ public override void OnPreferenceGUI()
320337 // disabling enableWaveHandGesture only save some data fetching time, it doesn't stop hardware/runtime gesture detaction
321338 if ( shouldSupport ) { VRModuleSettings . enableWaveHandGesture = true ; }
322339 }
340+ #endif
323341 }
324342#elif UNITY_2018_1_OR_NEWER
325343 GUI . enabled = false ;
@@ -357,13 +375,27 @@ public override void OnPreferenceGUI()
357375 EditorGUILayout . BeginHorizontal ( ) ;
358376#if VIU_WAVEVR_TRACKER_CHECK && VIU_WAVEVR_TRACKER
359377 {
360- var supported = EditorPrefs . GetBool ( "Wave/Tracker/EnableTracker" , false ) && VRModuleSettings . activateWaveTrackerSubmodule ;
378+ #if VIU_WAVE_NATIVE_5_1_1_OR_NEWER
379+ Wave . XR . Settings . WaveXRSettings settings = Wave . XR . Settings . WaveXRSettings . GetInstance ( ) ;
380+ if ( settings != null )
381+ {
382+ var supported = settings . EnableTracker && VRModuleSettings . activateWaveTrackerSubmodule ;
383+ var shouldSupport = EditorGUILayout . ToggleLeft ( new GUIContent ( enableWaveTrackerTitle ) , supported ) ;
384+ if ( supported != shouldSupport )
385+ {
386+ settings . EnableTracker = shouldSupport ;
387+ VRModuleSettings . activateWaveTrackerSubmodule = shouldSupport ;
388+ }
389+ }
390+ #else
391+ var supported = EditorPrefs . GetBool ( "Wave/Tracker/Enable Tracker" , false ) && VRModuleSettings . activateWaveTrackerSubmodule ;
361392 var shouldSupport = EditorGUILayout . ToggleLeft ( new GUIContent ( enableWaveTrackerTitle ) , supported ) ;
362393 if ( supported != shouldSupport )
363394 {
364395 Wave . XR . BuildCheck . CheckIfTrackerEnabled . PerformAction ( shouldSupport ) ;
365396 VRModuleSettings . activateWaveTrackerSubmodule = shouldSupport ;
366397 }
398+ #endif
367399 }
368400#elif UNITY_2018_1_OR_NEWER
369401 GUI . enabled = false ;
0 commit comments