55using System . Collections . Generic ;
66using UnityEngine ;
77
8- #if UNITY_EDITOR || UNITY_WSA
8+ #if UNITY_WSA
99using 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>
0 commit comments