Skip to content

Commit f9b676d

Browse files
author
David Kline
authored
Merge pull request #9412 from keveleigh/fix-reading-mode
Update legacy and XR SDK implementation for renderViewportScaleSlider
2 parents de1a6df + 0a85e3c commit f9b676d

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

Assets/MRTK/Examples/Demos/ReadingMode/Scripts/ReadingModeSceneBehavior.cs

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,9 @@
33

44
using Microsoft.MixedReality.Toolkit.CameraSystem;
55
using Microsoft.MixedReality.Toolkit.UI;
6-
using UnityEngine;
7-
8-
#if UNITY_2019_3_OR_NEWER
96
using Microsoft.MixedReality.Toolkit.Utilities;
10-
#endif // UNITY_2019_3_OR_NEWER
11-
12-
#if !UNITY_2020_1_OR_NEWER
7+
using UnityEngine;
138
using UnityEngine.XR;
14-
#endif // !UNITY_2020_1_OR_NEWER
159

1610
namespace Microsoft.MixedReality.Toolkit.Examples.Demos.ReadingMode
1711
{
@@ -35,20 +29,10 @@ private void Update()
3529

3630
previousSliderValue = renderViewportScaleSlider.SliderValue;
3731

38-
#if UNITY_2019_3_OR_NEWER
39-
if (XRSubsystemHelpers.DisplaySubsystem != null)
40-
{
41-
XRSubsystemHelpers.DisplaySubsystem.scaleOfAllViewports = Mathf.Max(renderViewportScaleSlider.SliderValue, MinScale);
42-
return;
43-
}
44-
#endif // UNITY_2019_3_OR_NEWER
45-
46-
#if !UNITY_2020_1_OR_NEWER
47-
if (XRDevice.isPresent)
32+
if (DeviceUtility.IsPresent)
4833
{
4934
XRSettings.renderViewportScale = Mathf.Max(renderViewportScaleSlider.SliderValue, MinScale);
5035
}
51-
#endif // !UNITY_2020_1_OR_NEWER
5236
}
5337

5438
public void EnableReadingMode()

0 commit comments

Comments
 (0)