Skip to content

Commit 900f29b

Browse files
Merge pull request #1175 from StephenHodgson/MRTK-Dev-Local
Dev Changes before Master Merge
2 parents 8fd817d + 7821e16 commit 900f29b

File tree

78 files changed

+5394
-1561
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+5394
-1561
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
1-
using UnityEngine;
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See LICENSE in the project root for license information.
3+
4+
using UnityEngine;
25
using HoloToolkit.Unity;
36

47
public class AdaptiveQualityExample : MonoBehaviour
58
{
6-
public TextMesh text;
7-
public AdaptiveQuality quality;
9+
public TextMesh Text;
10+
public AdaptiveQuality Quality;
811

9-
private void Update ()
10-
{
11-
text.text = string.Format("GPUTime:{0:N2}\nQualityLevel:{1}\nViewportScale:{2:N2}",
12-
GpuTiming.GetTime("Frame") * 1000.0f,
13-
quality.QualityLevel,
14-
UnityEngine.XR.XRSettings.renderViewportScale);
15-
}
12+
private void Update()
13+
{
14+
Text.text = string.Format("GPUTime:{0:N2}\nQualityLevel:{1}\nViewportScale:{2:N2}",
15+
GpuTiming.GetTime("Frame") * 1000.0f,
16+
Quality.QualityLevel,
17+
#if UNITY_2017_2_OR_NEWER
18+
UnityEngine.XR.XRSettings.renderViewportScale);
19+
#else
20+
UnityEngine.VR.VRSettings.renderViewportScale);
21+
#endif
22+
}
1623
}

Assets/HoloToolkit-Examples/Boundary/Scripts/BoundaryTest.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class BoundaryTest : MonoBehaviour
1111

1212
private void Start()
1313
{
14-
#if UNITY_WSA
14+
#if UNITY_WSA && UNITY_2017_2_OR_NEWER
1515
BoundaryManager.Instance.RenderBoundary = true;
1616
BoundaryManager.Instance.RenderFloor = true;
1717

Assets/HoloToolkit-Examples/Input/Scripts/OnFocusEvent.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ public class OnFocusEvent : MonoBehaviour, IFocusable
1313

1414
public void OnFocusEnter()
1515
{
16-
if (enabled && FocusEnterEvent != null)
16+
if (FocusEnterEvent != null)
1717
{
1818
FocusEnterEvent.Invoke();
1919
}
2020
}
2121

2222
public void OnFocusExit()
2323
{
24-
if (enabled && FocusLostEvent != null)
24+
if (FocusLostEvent != null)
2525
{
2626
FocusLostEvent.Invoke();
2727
}

Assets/HoloToolkit-Examples/Sharing/SharingService/Scripts/ImportExportAnchorManager.cs

+7-1
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,15 @@
88

99
#if UNITY_WSA && !UNITY_EDITOR
1010
using System.Collections.Generic;
11+
#if UNITY_2017_2_OR_NEWER
1112
using UnityEngine.XR.WSA;
1213
using UnityEngine.XR.WSA.Persistence;
1314
using UnityEngine.XR.WSA.Sharing;
15+
#else
16+
using UnityEngine.VR.WSA;
17+
using UnityEngine.VR.WSA.Persistence;
18+
using UnityEngine.VR.WSA.Sharing;
19+
#endif
1420
#endif
1521

1622
namespace HoloToolkit.Sharing.Tests
@@ -199,7 +205,7 @@ private static bool ShouldLocalUserCreateRoom
199205
/// </summary>
200206
private RoomManagerAdapter roomManagerListener;
201207

202-
#region Untiy APIs
208+
#region Unity APIs
203209

204210
protected override void Awake()
205211
{

Assets/HoloToolkit-Examples/SpatialMapping/Scripts/DropCube.cs

+20-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
using UnityEngine;
66

77
#if UNITY_WSA
8+
#if UNITY_2017_2_OR_NEWER
89
using UnityEngine.XR.WSA.Input;
10+
#else
11+
using UnityEngine.VR.WSA.Input;
12+
#endif
913
#endif
1014

1115
namespace HoloToolkit.Examples.SpatialMappingComponent
@@ -22,16 +26,30 @@ private void Start()
2226
{
2327
recognizer = new GestureRecognizer();
2428
recognizer.SetRecognizableGestures(GestureSettings.Tap);
29+
#if UNITY_2017_2_OR_NEWER
2530
recognizer.Tapped += Recognizer_Tapped;
31+
#else
32+
recognizer.TappedEvent += Recognizer_Tapped;
33+
#endif
2634
recognizer.StartCapturingGestures();
2735
}
2836

2937
private void OnDestroy()
3038
{
39+
#if UNITY_2017_2_OR_NEWER
3140
recognizer.Tapped -= Recognizer_Tapped;
41+
#else
42+
recognizer.TappedEvent -= Recognizer_Tapped;
43+
#endif
3244
}
3345

34-
private void Recognizer_Tapped(TappedEventArgs obj)
46+
private void Recognizer_Tapped(
47+
#if UNITY_2017_2_OR_NEWER
48+
TappedEventArgs obj
49+
#else
50+
InteractionSourceKind source, int tapCount, Ray headRay
51+
#endif
52+
)
3553
{
3654
// Create a cube
3755
var cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
@@ -40,7 +58,7 @@ private void Recognizer_Tapped(TappedEventArgs obj)
4058
// Start to drop it in front of the camera
4159
cube.transform.position = CameraCache.Main.transform.position + CameraCache.Main.transform.forward;
4260
// Apply physics
43-
cube.AddComponent<Rigidbody>();
61+
cube.AddComponent<Rigidbody>();
4462
}
4563
#endif
4664
}

0 commit comments

Comments
 (0)