File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
Assets/MixedRealityToolkit.Providers/WindowsMixedReality Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -227,7 +227,14 @@ private void UpdateHandData(InteractionSourceState interactionSourceState)
227227 HandPose handPose = sourceState . TryGetHandPose ( ) ;
228228
229229#if WINDOWS_UWP
230- if ( CoreServices . InputSystem . InputSystemProfile . HandTrackingProfile . EnableHandMeshVisualization )
230+ MixedRealityHandTrackingProfile handTrackingProfile = null ;
231+ MixedRealityInputSystemProfile inputSystemProfile = CoreServices . InputSystem ? . InputSystemProfile ;
232+ if ( inputSystemProfile != null )
233+ {
234+ handTrackingProfile = inputSystemProfile . HandTrackingProfile ;
235+ }
236+
237+ if ( handTrackingProfile != null && handTrackingProfile . EnableHandMeshVisualization )
231238 {
232239 // Accessing the hand mesh data involves copying quite a bit of data, so only do it if application requests it.
233240 if ( handMeshObserver == null && ! hasRequestedHandMeshObserver )
Original file line number Diff line number Diff line change @@ -158,7 +158,14 @@ private void UpdateHandData(InputDevice inputDevice)
158158 }
159159
160160#if WINDOWS_UWP
161- if ( ! CoreServices . InputSystem . InputSystemProfile . HandTrackingProfile . EnableHandMeshVisualization )
161+ MixedRealityHandTrackingProfile handTrackingProfile = null ;
162+ MixedRealityInputSystemProfile inputSystemProfile = CoreServices . InputSystem ? . InputSystemProfile ;
163+ if ( inputSystemProfile != null )
164+ {
165+ handTrackingProfile = inputSystemProfile . HandTrackingProfile ;
166+ }
167+
168+ if ( handTrackingProfile == null || ! handTrackingProfile . EnableHandMeshVisualization )
162169 {
163170 // if hand mesh visualization is disabled make sure to destroy our hand mesh observer if it has already been created
164171 if ( handMeshObserver != null )
You can’t perform that action at this time.
0 commit comments