Skip to content

Commit f82aa59

Browse files
authored
Guard only to Windows (#10595)
1 parent 4e7485b commit f82aa59

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

Assets/MRTK/SDK/Experimental/SpatialAwareness/SurfaceMeshesToPlanes.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33

44
using Microsoft.MixedReality.Toolkit.SpatialAwareness;
55
using Microsoft.MixedReality.Toolkit.Utilities;
6-
using System;
76
using System.Collections.Generic;
87
using System.Threading;
98
using System.Threading.Tasks;
109
using UnityEngine;
1110

12-
#if PLANE_FINDING_PRESENT
11+
#if PLANE_FINDING_PRESENT && (UNITY_WSA || UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN)
1312
using Microsoft.MixedReality.Toolkit.SpatialAwareness.Processing;
13+
using System;
1414
#endif
1515

1616
namespace Microsoft.MixedReality.Toolkit.Experimental.SpatialAwareness
@@ -156,7 +156,7 @@ public SpatialAwarenessSurfaceTypes DestroyPlanesMask
156156
set => destroyPlanesMask = value;
157157
}
158158

159-
#if PLANE_FINDING_PRESENT
159+
#if PLANE_FINDING_PRESENT && (UNITY_WSA || UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN)
160160
/// <summary>
161161
/// Delegate which is called when the MakePlanesCompleted event is triggered.
162162
/// </summary>
@@ -166,7 +166,7 @@ public SpatialAwarenessSurfaceTypes DestroyPlanesMask
166166
/// EventHandler which is triggered when the MakePlanesRoutine is finished.
167167
/// </summary>
168168
public event EventHandler MakePlanesComplete;
169-
#endif // PLANE_FINDING_PRESENT
169+
#endif // PLANE_FINDING_PRESENT && (UNITY_WSA || UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN)
170170

171171
/// <summary>
172172
/// Indicates whether or not the project contains the required components for SurfaceMeshesToPlanes
@@ -177,11 +177,11 @@ public SpatialAwarenessSurfaceTypes DestroyPlanesMask
177177
/// must be imported.
178178
/// </remarks>
179179
public static bool CanCreatePlanes =>
180-
#if PLANE_FINDING_PRESENT
180+
#if PLANE_FINDING_PRESENT && (UNITY_WSA || UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN)
181181
true;
182182
#else
183183
false;
184-
#endif // PLANE_FINDING_PRESENT
184+
#endif // PLANE_FINDING_PRESENT && (UNITY_WSA || UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN)
185185

186186
#endregion
187187

@@ -191,11 +191,11 @@ public SpatialAwarenessSurfaceTypes DestroyPlanesMask
191191
private bool makingPlanes = false;
192192
private CancellationTokenSource tokenSource;
193193

194-
#if PLANE_FINDING_PRESENT
194+
#if PLANE_FINDING_PRESENT && (UNITY_WSA || UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN)
195195
private float floorYPosition;
196196
private float ceilingYPosition;
197197
private const float SnapToGravityThreshold = 5.0f;
198-
#endif // PLANE_FINDING_PRESENT
198+
#endif // PLANE_FINDING_PRESENT && (UNITY_WSA || UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN)
199199

200200
#endregion
201201

@@ -265,7 +265,7 @@ private async Task MakePlanes(CancellationToken cancellationToken)
265265
{
266266
await new WaitForUpdate();
267267

268-
#if PLANE_FINDING_PRESENT
268+
#if PLANE_FINDING_PRESENT && (UNITY_WSA || UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN)
269269
List<PlaneFinding.MeshData> meshData = new List<PlaneFinding.MeshData>();
270270
List<MeshFilter> filters = new List<MeshFilter>();
271271

@@ -307,11 +307,11 @@ private async Task MakePlanes(CancellationToken cancellationToken)
307307

308308
// We are done creating planes, trigger an event.
309309
MakePlanesComplete?.Invoke(this, EventArgs.Empty);
310-
#endif // PLANE_FINDING_PRESENT
310+
#endif // PLANE_FINDING_PRESENT && (UNITY_WSA || UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN)
311311
makingPlanes = false;
312312
}
313313

314-
#if PLANE_FINDING_PRESENT
314+
#if PLANE_FINDING_PRESENT && (UNITY_WSA || UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN)
315315
/// <summary>
316316
/// Create game objects to represent bounded planes in scene
317317
/// </summary>
@@ -456,8 +456,8 @@ private void SetPlaneVisibility(SpatialAwarenessPlanarObject plane)
456456
{
457457
plane.GameObject.SetActive((drawPlanesMask & plane.SurfaceType) == plane.SurfaceType);
458458
}
459-
#endif // PLANE_FINDING_PRESENT
459+
#endif // PLANE_FINDING_PRESENT && (UNITY_WSA || UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN)
460460

461461
#endregion
462462
}
463-
}
463+
}

0 commit comments

Comments
 (0)