From b64c73bb3fdc57e559861a8aac16fd0c427afd14 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Wed, 19 Aug 2020 17:40:34 -0700 Subject: [PATCH] Fix compile errors in 2020.2 --- Runtime/Scripts/Core/VRView.cs | 10 ++++++++-- .../FunctionalityInjection/IUsesDeviceType.cs | 4 ++++ Runtime/Scripts/Proxies/Vive/ViveProxy.cs | 2 ++ Runtime/libs/input-prototype | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Runtime/Scripts/Core/VRView.cs b/Runtime/Scripts/Core/VRView.cs index 774a595fe..d497f9636 100644 --- a/Runtime/Scripts/Core/VRView.cs +++ b/Runtime/Scripts/Core/VRView.cs @@ -463,9 +463,11 @@ void DoDrawCamera(Rect rect) if (Event.current.type == EventType.Repaint) { #pragma warning disable 618 +#if !UNITY_2020_2_OR_NEWER if (XRDevice.isPresent) UnityEditor.Handles.DrawCamera(rect, m_Camera, m_RenderMode); else +#endif m_Camera.Render(); #pragma warning restore 618 @@ -506,9 +508,13 @@ void UpdateHMDStatus() internal static bool GetIsUserPresent() { +#if UNITY_2020_2_OR_NEWER + return false; +#else #pragma warning disable 618 return XRDevice.userPresence == UserPresenceState.Present; #pragma warning restore 618 +#endif } void SetGameViewsAutoRepaint(bool enabled) @@ -544,5 +550,5 @@ void SetAutoRepaintOnSceneChanged(Type viewType, bool enabled) } } #endif - } -} + } + } diff --git a/Runtime/Scripts/Interfaces/FunctionalityInjection/IUsesDeviceType.cs b/Runtime/Scripts/Interfaces/FunctionalityInjection/IUsesDeviceType.cs index ff7cffe85..d75c594f3 100644 --- a/Runtime/Scripts/Interfaces/FunctionalityInjection/IUsesDeviceType.cs +++ b/Runtime/Scripts/Interfaces/FunctionalityInjection/IUsesDeviceType.cs @@ -26,6 +26,9 @@ static class UsesDeviceTypeMethods /// The device type public static DeviceType GetDeviceType(this IUsesDeviceType @this) { +#if UNITY_2020_2_OR_NEWER + return default; +#else #pragma warning disable 618 if (string.IsNullOrEmpty(s_XRDeviceModel)) s_XRDeviceModel = XRDevice.model; @@ -33,6 +36,7 @@ public static DeviceType GetDeviceType(this IUsesDeviceType @this) return s_XRDeviceModel.IndexOf("oculus", StringComparison.OrdinalIgnoreCase) >= 0 ? DeviceType.Oculus : DeviceType.Vive; +#endif } } } diff --git a/Runtime/Scripts/Proxies/Vive/ViveProxy.cs b/Runtime/Scripts/Proxies/Vive/ViveProxy.cs index 0c9c04238..576d42cbc 100644 --- a/Runtime/Scripts/Proxies/Vive/ViveProxy.cs +++ b/Runtime/Scripts/Proxies/Vive/ViveProxy.cs @@ -24,9 +24,11 @@ sealed class ViveProxy : TwoHandedProxyBase protected override void Awake() { +#if !UNITY_2020_2_OR_NEWER #pragma warning disable 618 m_IsOculus = XRDevice.model.IndexOf("oculus", StringComparison.OrdinalIgnoreCase) >= 0; #pragma warning restore 618 +#endif if (m_IsOculus) { diff --git a/Runtime/libs/input-prototype b/Runtime/libs/input-prototype index 5b99a66f9..7579a34c1 160000 --- a/Runtime/libs/input-prototype +++ b/Runtime/libs/input-prototype @@ -1 +1 @@ -Subproject commit 5b99a66f9d32fd173ba7f19fbbfefd21f6255f1e +Subproject commit 7579a34c1ae91a7661b6d41c7ee6a40f48576da2