Skip to content

Commit 6ccd172

Browse files
author
Stephen Hodgson
committed
a few more replacements for the editor declaration
1 parent 18adfc9 commit 6ccd172

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

Assets/HoloToolkit/SharingWithUNET/UI/Scripts/StartSessionButton.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@ public class StartSessionButton : MonoBehaviour, IInputClickHandler
1919
void Start()
2020
{
2121
networkDiscovery = NetworkDiscoveryWithAnchors.Instance;
22-
#if !UNITY_EDITOR
23-
if (UnityEngine.XR.WSA.HolographicSettings.IsDisplayOpaque)
22+
if (UnityEngine.XR.WSA.HolographicSettings.IsDisplayOpaque && !Application.isEditor)
2423
{
2524
Debug.Log("Only hololens can host for now");
2625
Destroy(this.gameObject);
2726
}
28-
#endif
2927
}
3028

3129
/// <summary>
@@ -39,12 +37,13 @@ public void OnInputClicked(InputClickedEventData eventData)
3937
// Only let hololens host
4038
// We are also allowing the editor to host for testing purposes, but shared anchors
4139
// will currently not work in this mode.
42-
#if !UNITY_EDITOR
43-
if (!UnityEngine.XR.WSA.HolographicSettings.IsDisplayOpaque)
44-
#else
45-
Debug.Log("Unity editor can host, but World Anchors will not be shared");
46-
#endif
40+
if (!UnityEngine.XR.WSA.HolographicSettings.IsDisplayOpaque || Application.isEditor)
4741
{
42+
if (Application.isEditor)
43+
{
44+
Debug.Log("Unity editor can host, but World Anchors will not be shared");
45+
}
46+
4847
networkDiscovery.StartHosting("DefaultName");
4948
eventData.Use();
5049
}

Assets/HoloToolkit/SpatialMapping/Scripts/ObjectSurfaceObserver.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@ public class ObjectSurfaceObserver : SpatialMappingSource
1313
[Tooltip("If greater than or equal to zero, surface objects will claim to be updated at this period. This is useful when working with libraries that respond to updates (such as the SpatialUnderstanding library). If negative, surfaces will not claim to be updated.")]
1414
public float SimulatedUpdatePeriodInSeconds = -1;
1515

16-
// Use this for initialization.
1716
private void Start()
1817
{
19-
#if UNITY_EDITOR
20-
if (!UnityEngine.XR.XRDevice.isPresent)
18+
if (!UnityEngine.XR.XRDevice.isPresent && Application.isEditor)
2119
{
2220
// When in the Unity editor and not remoting, try loading saved meshes from a model.
2321
Load(RoomModel);
@@ -27,7 +25,6 @@ private void Start()
2725
SpatialMappingManager.Instance.SetSpatialMappingSource(this);
2826
}
2927
}
30-
#endif
3128
}
3229

3330
/// <summary>

0 commit comments

Comments
 (0)