3
3
4
4
using Microsoft . MixedReality . Toolkit . SpatialAwareness ;
5
5
using Microsoft . MixedReality . Toolkit . Utilities ;
6
- using System ;
7
6
using System . Collections . Generic ;
8
7
using System . Threading ;
9
8
using System . Threading . Tasks ;
10
9
using UnityEngine ;
11
10
12
- #if PLANE_FINDING_PRESENT
11
+ #if PLANE_FINDING_PRESENT && ( UNITY_WSA || UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN )
13
12
using Microsoft . MixedReality . Toolkit . SpatialAwareness . Processing ;
13
+ using System ;
14
14
#endif
15
15
16
16
namespace Microsoft . MixedReality . Toolkit . Experimental . SpatialAwareness
@@ -156,7 +156,7 @@ public SpatialAwarenessSurfaceTypes DestroyPlanesMask
156
156
set => destroyPlanesMask = value ;
157
157
}
158
158
159
- #if PLANE_FINDING_PRESENT
159
+ #if PLANE_FINDING_PRESENT && ( UNITY_WSA || UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN )
160
160
/// <summary>
161
161
/// Delegate which is called when the MakePlanesCompleted event is triggered.
162
162
/// </summary>
@@ -166,7 +166,7 @@ public SpatialAwarenessSurfaceTypes DestroyPlanesMask
166
166
/// EventHandler which is triggered when the MakePlanesRoutine is finished.
167
167
/// </summary>
168
168
public event EventHandler MakePlanesComplete ;
169
- #endif // PLANE_FINDING_PRESENT
169
+ #endif // PLANE_FINDING_PRESENT && (UNITY_WSA || UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN)
170
170
171
171
/// <summary>
172
172
/// Indicates whether or not the project contains the required components for SurfaceMeshesToPlanes
@@ -177,11 +177,11 @@ public SpatialAwarenessSurfaceTypes DestroyPlanesMask
177
177
/// must be imported.
178
178
/// </remarks>
179
179
public static bool CanCreatePlanes =>
180
- #if PLANE_FINDING_PRESENT
180
+ #if PLANE_FINDING_PRESENT && ( UNITY_WSA || UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN )
181
181
true ;
182
182
#else
183
183
false ;
184
- #endif // PLANE_FINDING_PRESENT
184
+ #endif // PLANE_FINDING_PRESENT && (UNITY_WSA || UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN)
185
185
186
186
#endregion
187
187
@@ -191,11 +191,11 @@ public SpatialAwarenessSurfaceTypes DestroyPlanesMask
191
191
private bool makingPlanes = false ;
192
192
private CancellationTokenSource tokenSource ;
193
193
194
- #if PLANE_FINDING_PRESENT
194
+ #if PLANE_FINDING_PRESENT && ( UNITY_WSA || UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN )
195
195
private float floorYPosition ;
196
196
private float ceilingYPosition ;
197
197
private const float SnapToGravityThreshold = 5.0f ;
198
- #endif // PLANE_FINDING_PRESENT
198
+ #endif // PLANE_FINDING_PRESENT && (UNITY_WSA || UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN)
199
199
200
200
#endregion
201
201
@@ -265,7 +265,7 @@ private async Task MakePlanes(CancellationToken cancellationToken)
265
265
{
266
266
await new WaitForUpdate ( ) ;
267
267
268
- #if PLANE_FINDING_PRESENT
268
+ #if PLANE_FINDING_PRESENT && ( UNITY_WSA || UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN )
269
269
List < PlaneFinding . MeshData > meshData = new List < PlaneFinding . MeshData > ( ) ;
270
270
List < MeshFilter > filters = new List < MeshFilter > ( ) ;
271
271
@@ -307,11 +307,11 @@ private async Task MakePlanes(CancellationToken cancellationToken)
307
307
308
308
// We are done creating planes, trigger an event.
309
309
MakePlanesComplete ? . Invoke ( this , EventArgs . Empty ) ;
310
- #endif // PLANE_FINDING_PRESENT
310
+ #endif // PLANE_FINDING_PRESENT && (UNITY_WSA || UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN)
311
311
makingPlanes = false ;
312
312
}
313
313
314
- #if PLANE_FINDING_PRESENT
314
+ #if PLANE_FINDING_PRESENT && ( UNITY_WSA || UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN )
315
315
/// <summary>
316
316
/// Create game objects to represent bounded planes in scene
317
317
/// </summary>
@@ -456,8 +456,8 @@ private void SetPlaneVisibility(SpatialAwarenessPlanarObject plane)
456
456
{
457
457
plane . GameObject . SetActive ( ( drawPlanesMask & plane . SurfaceType ) == plane . SurfaceType ) ;
458
458
}
459
- #endif // PLANE_FINDING_PRESENT
459
+ #endif // PLANE_FINDING_PRESENT && (UNITY_WSA || UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN)
460
460
461
461
#endregion
462
462
}
463
- }
463
+ }
0 commit comments