Skip to content

Commit 7142214

Browse files
better cursor handling
1 parent 87133ae commit 7142214

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Assets/MixedRealityToolkit-SDK/Features/UX/Scripts/Pointers/MousePointer.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,12 @@ public override void OnSourcePoseChanged(SourcePoseEventData<Vector2> eventData)
9393

9494
if (UseSourcePoseData)
9595
{
96-
if (!BaseCursor.IsVisible &&
96+
if (BaseCursor != null &&
97+
!BaseCursor.IsVisible &&
9798
(eventData.SourceData.x >= movementThresholdToUnHide ||
9899
eventData.SourceData.y >= MovementThresholdToUnHide))
99100
{
100-
BaseCursor?.SetVisibility(true);
101+
BaseCursor.SetVisibility(true);
101102
transform.rotation = CameraCache.Main.transform.rotation;
102103
}
103104

@@ -116,11 +117,12 @@ public override void OnPositionInputChanged(InputEventData<Vector2> eventData)
116117
if (!UseSourcePoseData &&
117118
PoseAction == eventData.MixedRealityInputAction)
118119
{
119-
if (!BaseCursor.IsVisible &&
120+
if (BaseCursor != null &&
121+
!BaseCursor.IsVisible &&
120122
(eventData.InputData.x >= movementThresholdToUnHide ||
121123
eventData.InputData.y >= MovementThresholdToUnHide))
122124
{
123-
BaseCursor?.SetVisibility(true);
125+
BaseCursor.SetVisibility(true);
124126
transform.rotation = CameraCache.Main.transform.rotation;
125127
}
126128

0 commit comments

Comments
 (0)