|
4 | 4 | using Microsoft.MixedReality.Toolkit.Input;
|
5 | 5 | using Microsoft.MixedReality.Toolkit.Utilities;
|
6 | 6 | using System;
|
7 |
| -using UnityEngine.XR; |
8 | 7 |
|
9 |
| -#if WMR_2_7_OR_NEWER_ENABLED |
| 8 | +// These versions represent the first version eye tracking became usable across Unity 2019/2020/2021 |
| 9 | +// WMR_2_7_0_OR_NEWER stops being defined at 3.0 and WMR_4_4_2_OR_NEWER stops being defined at 5.0, exclusive |
| 10 | +#if WMR_2_7_0_OR_NEWER || WMR_4_4_2_OR_NEWER || WMR_5_2_2_OR_NEWER |
10 | 11 | using Unity.Profiling;
|
11 | 12 | using Unity.XR.WindowsMR;
|
12 | 13 | using UnityEngine;
|
13 |
| -#endif // WMR_2_7_OR_NEWER_ENABLED |
| 14 | +using UnityEngine.XR; |
| 15 | +#endif // WMR_2_7_0_OR_NEWER || WMR_4_4_2_OR_NEWER || WMR_5_2_2_OR_NEWER |
14 | 16 |
|
15 | 17 | namespace Microsoft.MixedReality.Toolkit.XRSDK.WindowsMixedReality
|
16 | 18 | {
|
@@ -69,18 +71,18 @@ public WindowsMixedRealityEyeGazeDataProvider(
|
69 | 71 |
|
70 | 72 | /// <inheritdoc />
|
71 | 73 | public bool CheckCapability(MixedRealityCapability capability) =>
|
72 |
| -#if WMR_2_7_OR_NEWER_ENABLED |
| 74 | +#if WMR_2_7_0_OR_NEWER || WMR_4_4_2_OR_NEWER || WMR_5_2_2_OR_NEWER |
73 | 75 | capability == MixedRealityCapability.EyeTracking
|
74 | 76 | && centerEye.isValid
|
75 | 77 | && centerEye.TryGetFeatureValue(WindowsMRUsages.EyeGazeAvailable, out bool gazeAvailable)
|
76 | 78 | && gazeAvailable;
|
77 | 79 | #else
|
78 | 80 | false;
|
79 |
| -#endif // WMR_2_7_OR_NEWER_ENABLED |
| 81 | +#endif // WMR_2_7_0_OR_NEWER || WMR_4_4_2_OR_NEWER || WMR_5_2_2_OR_NEWER |
80 | 82 |
|
81 | 83 | #endregion IMixedRealityCapabilityCheck Implementation
|
82 | 84 |
|
83 |
| -#if WMR_2_7_OR_NEWER_ENABLED |
| 85 | +#if WMR_2_7_0_OR_NEWER || WMR_4_4_2_OR_NEWER || WMR_5_2_2_OR_NEWER |
84 | 86 | private InputDevice centerEye = default(InputDevice);
|
85 | 87 |
|
86 | 88 | /// <inheritdoc />
|
@@ -161,6 +163,6 @@ public override void Update()
|
161 | 163 | }
|
162 | 164 | }
|
163 | 165 | }
|
164 |
| -#endif // WMR_2_7_OR_NEWER_ENABLED |
| 166 | +#endif // WMR_2_7_0_OR_NEWER || WMR_4_4_2_OR_NEWER || WMR_5_2_2_OR_NEWER |
165 | 167 | }
|
166 | 168 | }
|
0 commit comments