|
1 | 1 | // Copyright (c) Microsoft Corporation. All rights reserved. |
2 | 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. |
3 | 3 |
|
4 | | -using Microsoft.MixedReality.Toolkit.InputSystem.Pointers; |
5 | | -using Microsoft.MixedReality.Toolkit.InputSystem.Sources; |
6 | 4 | using Microsoft.MixedReality.Toolkit.Core.Definitions.InputSystem; |
7 | 5 | using Microsoft.MixedReality.Toolkit.Core.Definitions.Utilities; |
8 | 6 | using Microsoft.MixedReality.Toolkit.Core.EventDatum.Input; |
9 | 7 | using Microsoft.MixedReality.Toolkit.Core.Interfaces.Devices; |
10 | 8 | using Microsoft.MixedReality.Toolkit.Core.Interfaces.InputSystem; |
11 | 9 | using Microsoft.MixedReality.Toolkit.Core.Interfaces.InputSystem.Handlers; |
12 | 10 | using Microsoft.MixedReality.Toolkit.Core.Utilities; |
| 11 | +using Microsoft.MixedReality.Toolkit.Core.Utilities.Async; |
13 | 12 | using Microsoft.MixedReality.Toolkit.Core.Utilities.Physics; |
| 13 | +using Microsoft.MixedReality.Toolkit.InputSystem.Pointers; |
| 14 | +using Microsoft.MixedReality.Toolkit.InputSystem.Sources; |
14 | 15 | using UnityEngine; |
15 | 16 |
|
16 | 17 | namespace Microsoft.MixedReality.Toolkit.SDK.Input |
@@ -337,7 +338,7 @@ protected override void OnDisable() |
337 | 338 | { |
338 | 339 | base.OnDisable(); |
339 | 340 | GazePointer.BaseCursor?.SetVisibility(false); |
340 | | - InputSystem.RaiseSourceLost(GazeInputSource); |
| 341 | + InputSystem?.RaiseSourceLost(GazeInputSource); |
341 | 342 | } |
342 | 343 |
|
343 | 344 | #endregion MonoBehaviour Implementation |
@@ -387,8 +388,9 @@ private IMixedRealityPointer InitializeGazePointer() |
387 | 388 | return gazePointer = new InternalGazePointer(this, "Gaze Pointer", null, raycastLayerMasks, maxGazeCollisionDistance, gazeTransform, stabilizer); |
388 | 389 | } |
389 | 390 |
|
390 | | - private void RaiseSourceDetected() |
| 391 | + private async void RaiseSourceDetected() |
391 | 392 | { |
| 393 | + await WaitUntilInputSystemValid; |
392 | 394 | InputSystem.RaiseSourceDetected(GazeInputSource); |
393 | 395 | GazePointer.BaseCursor?.SetVisibility(true); |
394 | 396 | } |
|
0 commit comments