Skip to content

Commit a75c059

Browse files
authored
Merge pull request #1493 from StephenHodgson/MRTK-compatibility
MRTK Editor Compatibility
2 parents 8bdf718 + d3c1b3b commit a75c059

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

Assets/HoloToolkit/Boundary/Scripts/SceneContentAdjuster.cs

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

4-
using System.Collections;
54
using UnityEngine;
65

76
#if UNITY_2017_2_OR_NEWER
7+
using System.Collections;
88
using UnityEngine.XR;
99
#else
1010
using UnityEngine.VR;
@@ -63,19 +63,16 @@ private void Awake()
6363
// If no XR device is present, the editor will default to (0, 0, 0) and no adjustment is needed.
6464
// This script runs on both opaque and transparent display devices, since the floor offset is based on
6565
// TrackingSpaceType and not display type.
66-
if (!XRDevice.isPresent)
67-
#else
68-
if (true)
69-
#endif
70-
{
71-
Destroy(this);
72-
}
73-
else
66+
if (XRDevice.isPresent)
7467
{
7568
StartCoroutine(SetContentHeight());
69+
return;
7670
}
71+
#endif
72+
Destroy(this);
7773
}
7874

75+
#if UNITY_2017_2_OR_NEWER
7976
private IEnumerator SetContentHeight()
8077
{
8178
if (frameWaitHack < 1)
@@ -106,5 +103,6 @@ private IEnumerator SetContentHeight()
106103
containerObject.position = contentPosition;
107104
}
108105
}
106+
#endif
109107
}
110108
}

0 commit comments

Comments
 (0)