Skip to content

Commit

Permalink
Merge pull request #1493 from StephenHodgson/MRTK-compatibility
Browse files Browse the repository at this point in the history
MRTK Editor Compatibility
  • Loading branch information
NeerajW authored Dec 14, 2017
2 parents 8bdf718 + d3c1b3b commit a75c059
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions Assets/HoloToolkit/Boundary/Scripts/SceneContentAdjuster.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using System.Collections;
using UnityEngine;

#if UNITY_2017_2_OR_NEWER
using System.Collections;
using UnityEngine.XR;
#else
using UnityEngine.VR;
Expand Down Expand Up @@ -63,19 +63,16 @@ private void Awake()
// If no XR device is present, the editor will default to (0, 0, 0) and no adjustment is needed.
// This script runs on both opaque and transparent display devices, since the floor offset is based on
// TrackingSpaceType and not display type.
if (!XRDevice.isPresent)
#else
if (true)
#endif
{
Destroy(this);
}
else
if (XRDevice.isPresent)
{
StartCoroutine(SetContentHeight());
return;
}
#endif
Destroy(this);
}

#if UNITY_2017_2_OR_NEWER
private IEnumerator SetContentHeight()
{
if (frameWaitHack < 1)
Expand Down Expand Up @@ -106,5 +103,6 @@ private IEnumerator SetContentHeight()
containerObject.position = contentPosition;
}
}
#endif
}
}

0 comments on commit a75c059

Please sign in to comment.