Skip to content

Commit 83ec8ee

Browse files
author
Dmytro Ivanov
committed
Backporting fix for the issue of building XR/VR on platforms that don't have complete implementation.
1 parent fae414f commit 83ec8ee

File tree

20 files changed

+40
-33
lines changed

20 files changed

+40
-33
lines changed

Assets/QA/Tests/XRDeviceActions/_SharedScripts/Handedness.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
using UnityEngine.UI;
44
using UnityEngine.InputSystem.XR;
55

6+
#if ENABLE_VR || ENABLE_AR
7+
68
public class Handedness : MonoBehaviour
79
{
810
public Text statusText;
@@ -24,3 +26,4 @@ public void Update()
2426
statusText.text = handedness;
2527
}
2628
}
29+
#endif

Assets/QA/Tests/XRHaptics/XRHaptics.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
using UnityEngine.UI;
66

7+
#if ENABLE_VR || ENABLE_AR
78
public class XRHaptics : MonoBehaviour
89
{
910
public Image leftHapticDetected;
@@ -90,3 +91,5 @@ private void UpdateTimer()
9091
}
9192
}
9293
}
94+
95+
#endif

Assets/Tests/InputSystem/Plugins/XRTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#if UNITY_EDITOR || UNITY_STANDALONE || UNITY_ANDROID || UNITY_IOS || UNITY_WSA
2+
#if ENABLE_VR || ENABLE_AR
23
using System;
34
using NUnit.Framework;
45
using System.Collections.Generic;
@@ -693,4 +694,5 @@ public FourCC format
693694
}
694695
}
695696
}
697+
#endif
696698
#endif // UNITY_EDITOR || UNITY_STANDALONE || UNITY_ANDROID || UNITY_IOS || UNITY_WSA

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77
Due to package verification, the latest version below is the unpublished version and the date is meaningless.
88
however, it has to be formatted properly to pass verification tests.
99

10+
## [1.0.2] - 2021-1-13
11+
12+
- Fixed compilation issues with XR and VR references when building to platforms that do not have complete XR and VR implementations. Backported from 1.1.0-preview.1
13+
1014
## [1.0.1] - 2020-11-20
1115

1216
### Fixed

Packages/com.unity.inputsystem/InputSystem/InputSystem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3083,7 +3083,7 @@ private static void PerformDefaultPluginInitialization()
30833083
Switch.SwitchSupportHID.Initialize();
30843084
#endif
30853085

3086-
#if (UNITY_EDITOR || UNITY_STANDALONE || UNITY_ANDROID || UNITY_IOS || UNITY_WSA) && UNITY_INPUT_SYSTEM_ENABLE_XR
3086+
#if (UNITY_EDITOR || UNITY_STANDALONE || UNITY_ANDROID || UNITY_IOS || UNITY_WSA) && UNITY_INPUT_SYSTEM_ENABLE_XR && ENABLE_VR
30873087
XR.XRSupport.Initialize();
30883088
#endif
30893089

Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/GoogleVR.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if UNITY_INPUT_SYSTEM_ENABLE_XR && !DISABLE_BUILTIN_INPUT_SYSTEM_GOOGLEVR && !PACKAGE_DOCS_GENERATION
1+
#if UNITY_INPUT_SYSTEM_ENABLE_XR && ENABLE_VR && !DISABLE_BUILTIN_INPUT_SYSTEM_GOOGLEVR && !PACKAGE_DOCS_GENERATION
22
using UnityEngine.InputSystem.Controls;
33
using UnityEngine.InputSystem.Layouts;
44
using UnityEngine.InputSystem.XR;

Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/Oculus.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if UNITY_INPUT_SYSTEM_ENABLE_XR && !DISABLE_BUILTIN_INPUT_SYSTEM_OCULUS && !PACKAGE_DOCS_GENERATION
1+
#if UNITY_INPUT_SYSTEM_ENABLE_XR && ENABLE_VR && !DISABLE_BUILTIN_INPUT_SYSTEM_OCULUS && !PACKAGE_DOCS_GENERATION
22
using UnityEngine.InputSystem;
33
using UnityEngine.Scripting;
44
using UnityEngine.InputSystem.XR;

Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/OpenVR.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if UNITY_INPUT_SYSTEM_ENABLE_XR && !DISABLE_BUILTIN_INPUT_SYSTEM_OPENVR && !PACKAGE_DOCS_GENERATION
1+
#if UNITY_INPUT_SYSTEM_ENABLE_XR && ENABLE_VR && !DISABLE_BUILTIN_INPUT_SYSTEM_OPENVR && !PACKAGE_DOCS_GENERATION
22
using UnityEngine.InputSystem;
33
using UnityEngine.InputSystem.Controls;
44
using UnityEngine.InputSystem.Layouts;

Packages/com.unity.inputsystem/InputSystem/Plugins/XR/Devices/WindowsMR.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if UNITY_INPUT_SYSTEM_ENABLE_XR && !DISABLE_BUILTIN_INPUT_SYSTEM_WINDOWSMR && !PACKAGE_DOCS_GENERATION
1+
#if UNITY_INPUT_SYSTEM_ENABLE_XR && ENABLE_VR && !DISABLE_BUILTIN_INPUT_SYSTEM_WINDOWSMR && !PACKAGE_DOCS_GENERATION
22
using UnityEngine.InputSystem.XR;
33
using UnityEngine.InputSystem.Controls;
44
using UnityEngine.InputSystem.Layouts;

Packages/com.unity.inputsystem/InputSystem/Plugins/XR/GenericXRDevice.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if UNITY_INPUT_SYSTEM_ENABLE_XR || PACKAGE_DOCS_GENERATION
1+
#if (UNITY_INPUT_SYSTEM_ENABLE_XR && ENABLE_VR) || PACKAGE_DOCS_GENERATION
22
using UnityEngine.InputSystem.Controls;
33
using UnityEngine.InputSystem.XR.Haptics;
44
using UnityEngine.InputSystem.Layouts;

0 commit comments

Comments
 (0)