Skip to content

Commit eba8547

Browse files
author
Stephen Hodgson
committed
Removed redundant Editor Compilation declaration
1 parent af72386 commit eba8547

File tree

4 files changed

+33
-29
lines changed

4 files changed

+33
-29
lines changed

Assets/HoloToolkit-Examples/SpatialMappingComponent/DropCube.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using HoloToolkit.Unity;
55
using UnityEngine;
66

7-
#if UNITY_EDITOR || UNITY_WSA
7+
#if UNITY_WSA
88
using UnityEngine.XR.WSA.Input;
99
#endif
1010

@@ -15,7 +15,7 @@ namespace HoloToolkit.Examples.SpatialMappingComponent
1515
/// </summary>
1616
public class DropCube : MonoBehaviour
1717
{
18-
#if UNITY_EDITOR || UNITY_WSA
18+
#if UNITY_WSA
1919
private GestureRecognizer recognizer;
2020

2121
private void Start()

Assets/HoloToolkit/SpatialMapping/Scripts/SpatialMappingObserver.cs

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using System.Collections.Generic;
66
using UnityEngine;
77

8-
#if UNITY_EDITOR || UNITY_WSA
8+
#if UNITY_WSA
99
using UnityEngine.XR.WSA;
1010
#endif
1111

@@ -68,7 +68,8 @@ public class SpatialMappingObserver : SpatialMappingSource
6868
/// <summary>
6969
/// Indicates the current type of the observed volume
7070
/// </summary>
71-
[SerializeField][Tooltip("The shape of the observation volume.")]
71+
[SerializeField]
72+
[Tooltip("The shape of the observation volume.")]
7273
private ObserverVolumeTypes observerVolumeType = ObserverVolumeTypes.AxisAlignedBox;
7374
public ObserverVolumeTypes ObserverVolumeType
7475
{
@@ -78,15 +79,15 @@ public ObserverVolumeTypes ObserverVolumeType
7879
}
7980
set
8081
{
81-
if(observerVolumeType != value)
82+
if (observerVolumeType != value)
8283
{
8384
observerVolumeType = value;
8485
SwitchObservedVolume();
8586
}
8687
}
8788
}
8889

89-
#if UNITY_EDITOR || UNITY_WSA
90+
#if UNITY_WSA
9091
/// <summary>
9192
/// Our Surface Observer object for generating/updating Spatial Mapping data.
9293
/// </summary>
@@ -117,7 +118,8 @@ public ObserverVolumeTypes ObserverVolumeType
117118
/// </summary>
118119
private float updateTime;
119120

120-
[SerializeField][Tooltip("The extents of the observation volume.")]
121+
[SerializeField]
122+
[Tooltip("The extents of the observation volume.")]
121123
private Vector3 extents = Vector3.one * 10.0f;
122124
public Vector3 Extents
123125
{
@@ -127,7 +129,7 @@ public Vector3 Extents
127129
}
128130
set
129131
{
130-
if(extents != value)
132+
if (extents != value)
131133
{
132134
extents = value;
133135
SwitchObservedVolume();
@@ -138,7 +140,8 @@ public Vector3 Extents
138140
/// <summary>
139141
/// The origin of the observation volume.
140142
/// </summary>
141-
[SerializeField][Tooltip("The origin of the observation volume.")]
143+
[SerializeField]
144+
[Tooltip("The origin of the observation volume.")]
142145
private Vector3 origin = Vector3.zero;
143146
public Vector3 Origin
144147
{
@@ -148,7 +151,7 @@ public Vector3 Origin
148151
}
149152
set
150153
{
151-
if(origin != value)
154+
if (origin != value)
152155
{
153156
origin = value;
154157
SwitchObservedVolume();
@@ -159,7 +162,8 @@ public Vector3 Origin
159162
/// <summary>
160163
/// The direction of the observed volume, if an oriented box is choosen.
161164
/// </summary>
162-
[SerializeField][Tooltip("The direction of the observation volume.")]
165+
[SerializeField]
166+
[Tooltip("The direction of the observation volume.")]
163167
private Quaternion orientation = Quaternion.identity;
164168
public Quaternion Orientation
165169
{
@@ -169,11 +173,11 @@ public Quaternion Orientation
169173
}
170174
set
171175
{
172-
if(orientation != value)
176+
if (orientation != value)
173177
{
174178
orientation = value;
175179
// Only needs to be changed if the corresponding mode is active.
176-
if(ObserverVolumeType == ObserverVolumeTypes.OrientedBox)
180+
if (ObserverVolumeType == ObserverVolumeTypes.OrientedBox)
177181
{
178182
SwitchObservedVolume();
179183
}
@@ -188,7 +192,7 @@ protected override void Awake()
188192
ObserverState = ObserverStates.Stopped;
189193
}
190194

191-
#if UNITY_EDITOR || UNITY_WSA
195+
#if UNITY_WSA
192196
/// <summary>
193197
/// Called once per frame.
194198
/// </summary>
@@ -273,7 +277,7 @@ private void Update()
273277
/// </summary>
274278
public void StartObserving()
275279
{
276-
#if UNITY_EDITOR || UNITY_WSA
280+
#if UNITY_WSA
277281
if (observer == null)
278282
{
279283
observer = new SurfaceObserver();
@@ -297,7 +301,7 @@ public void StartObserving()
297301
/// <remarks>Sets the Surface Observer state to ObserverStates.Stopped.</remarks>
298302
public void StopObserving()
299303
{
300-
#if UNITY_EDITOR || UNITY_WSA
304+
#if UNITY_WSA
301305
if (ObserverState == ObserverStates.Running)
302306
{
303307
Debug.Log("Stopping the observer.");
@@ -314,7 +318,7 @@ public void StopObserving()
314318
/// </summary>
315319
public void CleanupObserver()
316320
{
317-
#if UNITY_EDITOR || UNITY_WSA
321+
#if UNITY_WSA
318322
StopObserving();
319323

320324
if (observer != null)
@@ -347,7 +351,7 @@ public bool SetObserverOrigin(Vector3 origin)
347351
{
348352
bool originUpdated = false;
349353

350-
#if UNITY_EDITOR || UNITY_WSA
354+
#if UNITY_WSA
351355
if (observer != null)
352356
{
353357
Origin = origin;
@@ -363,10 +367,10 @@ public bool SetObserverOrigin(Vector3 origin)
363367
/// </summary>
364368
private void SwitchObservedVolume()
365369
{
366-
#if UNITY_EDITOR || UNITY_WSA
370+
#if UNITY_WSA
367371
if (observer == null)
368372
{
369-
return;
373+
return;
370374
}
371375

372376
switch (observerVolumeType)
@@ -387,7 +391,7 @@ private void SwitchObservedVolume()
387391
#endif
388392
}
389393

390-
#if UNITY_EDITOR || UNITY_WSA
394+
#if UNITY_WSA
391395
/// <summary>
392396
/// Handles the SurfaceObserver's OnDataReady event.
393397
/// </summary>

Assets/HoloToolkit/SpatialUnderstanding/Scripts/SpatialUnderstandingCustomMesh.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
using UnityEngine;
88
using HoloToolkit.Unity.SpatialMapping;
99

10-
#if UNITY_EDITOR || UNITY_WSA
10+
#if UNITY_WSA
1111
using UnityEngine.XR.WSA;
1212
#endif
1313

@@ -189,7 +189,7 @@ public void Commit()
189189
public void AddTriangle(Vector3 point1, Vector3 point2, Vector3 point3)
190190
{
191191
// Currently spatial understanding in the native layer voxellizes the space
192-
// into ~2000 voxels per cubic meter. Even in a degerate case we
192+
// into ~2000 voxels per cubic meter. Even in a degenerate case we
193193
// will use far fewer than 65000 vertices, this check should not fail
194194
// unless the spatial understanding native layer is updated to have more
195195
// voxels per cubic meter.
@@ -214,7 +214,7 @@ public void AddTriangle(Vector3 point1, Vector3 point2, Vector3 point3)
214214
private void Start()
215215
{
216216
spatialUnderstanding = SpatialUnderstanding.Instance;
217-
#if UNITY_EDITOR || UNITY_WSA
217+
#if UNITY_WSA
218218
if (gameObject.GetComponent<WorldAnchor>() == null)
219219
{
220220
gameObject.AddComponent<WorldAnchor>();

Assets/HoloToolkit/Utilities/Scripts/StabilizationPlaneModifier.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using HoloToolkit.Unity.InputModule;
55
using UnityEngine;
66

7-
#if UNITY_EDITOR || UNITY_WSA
7+
#if UNITY_WSA
88
using UnityEngine.XR.WSA;
99
#endif
1010

@@ -186,7 +186,7 @@ private void ConfigureTransformOverridePlane(float deltaTime)
186186
velocity = UpdateVelocity(deltaTime);
187187
}
188188

189-
#if UNITY_EDITOR || UNITY_WSA
189+
#if UNITY_WSA
190190
// Place the plane at the desired depth in front of the user and billboard it to the gaze origin.
191191
HolographicSettings.SetFocusPointForFrame(planePosition, -GazeNormal, velocity);
192192
#endif
@@ -211,7 +211,7 @@ private void ConfigureGazeManagerPlane(float deltaTime)
211211
{
212212
focusPointDistance = DefaultPlaneDistance;
213213
}
214-
214+
215215
float lerpPower = focusPointDistance > currentPlaneDistance ? LerpStabilizationPlanePowerFarther
216216
: LerpStabilizationPlanePowerCloser;
217217

@@ -220,7 +220,7 @@ private void ConfigureGazeManagerPlane(float deltaTime)
220220

221221
planePosition = gazeOrigin + (gazeDirection * currentPlaneDistance);
222222

223-
#if UNITY_EDITOR || UNITY_WSA
223+
#if UNITY_WSA
224224
HolographicSettings.SetFocusPointForFrame(planePosition, -gazeDirection, Vector3.zero);
225225
#endif
226226
}
@@ -240,7 +240,7 @@ private void ConfigureFixedDistancePlane(float deltaTime)
240240
currentPlaneDistance = Mathf.Lerp(currentPlaneDistance, DefaultPlaneDistance, lerpPower * deltaTime);
241241

242242
planePosition = gazeOrigin + (gazeNormal * currentPlaneDistance);
243-
#if UNITY_EDITOR || UNITY_WSA
243+
#if UNITY_WSA
244244
HolographicSettings.SetFocusPointForFrame(planePosition, -gazeNormal, Vector3.zero);
245245
#endif
246246
}

0 commit comments

Comments
 (0)