Skip to content

Commit 86b3b79

Browse files
author
David Kline
authored
Merge pull request #3036 from StephenHodgson/vNext-MouseNulls
Fixed some null refs with mouse pointer
2 parents f4502f9 + 9272915 commit 86b3b79

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public override void OnSourcePoseChanged(SourcePoseEventData<Vector2> eventData)
144144
/// <inheritdoc />
145145
public override void OnInputDown(InputEventData eventData)
146146
{
147-
cursorWasDisabledOnDown = !BaseCursor.IsVisible;
147+
cursorWasDisabledOnDown = isDisabled;
148148

149149
if (cursorWasDisabledOnDown)
150150
{
@@ -160,7 +160,7 @@ public override void OnInputDown(InputEventData eventData)
160160
/// <inheritdoc />
161161
public override void OnInputUp(InputEventData eventData)
162162
{
163-
if (BaseCursor.IsVisible && !cursorWasDisabledOnDown)
163+
if (!isDisabled && !cursorWasDisabledOnDown)
164164
{
165165
base.OnInputUp(eventData);
166166
}
@@ -230,14 +230,15 @@ private void UpdateMousePosition(float mouseX, float mouseY)
230230
BaseCursor?.SetVisibility(true);
231231
transform.rotation = CameraCache.Main.transform.rotation;
232232
}
233-
else
234-
{
235-
timeoutTimer = 0.0f;
236-
}
237233

238234
isDisabled = false;
239235
}
240236

237+
if (!isDisabled)
238+
{
239+
timeoutTimer = 0.0f;
240+
}
241+
241242
var newRotation = Vector3.zero;
242243
newRotation.x += mouseX;
243244
newRotation.y += mouseY;

0 commit comments

Comments
 (0)