Skip to content

Commit 48d0e24

Browse files
committed
Replace Unity version or newer with XR Management version or newer
1 parent 20b0164 commit 48d0e24

File tree

4 files changed

+24
-16
lines changed

4 files changed

+24
-16
lines changed

Packages/webxr/Runtime/Scripts/WebXRManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public enum WebXRVisibilityState
1111
}
1212

1313
[DefaultExecutionOrder(-2020)]
14-
#if UNITY_2022_2_OR_NEWER || UNITY_2023_1_OR_NEWER
14+
#if UNITY_XR_MANAGEMENT_4_3_1_OR_NEWER
1515
public class WebXRManager : SubsystemLifecycleManager<WebXRSubsystem, WebXRSubsystemDescriptor, WebXRSubsystemProvider>
1616
#else
1717
public class WebXRManager : SubsystemLifecycleManager<WebXRSubsystem, WebXRSubsystemDescriptor>

Packages/webxr/Runtime/WebXR.asmdef

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "WebXR",
3+
"rootNamespace": "",
34
"references": [
45
"Unity.XR.Management",
56
"Unity.Subsystem.Registration"
@@ -11,6 +12,12 @@
1112
"precompiledReferences": [],
1213
"autoReferenced": false,
1314
"defineConstraints": [],
14-
"versionDefines": [],
15+
"versionDefines": [
16+
{
17+
"name": "com.unity.xr.management",
18+
"expression": "4.3.1",
19+
"define": "UNITY_XR_MANAGEMENT_4_3_1_OR_NEWER"
20+
}
21+
],
1522
"noEngineReferences": false
1623
}

Packages/webxr/Runtime/XRPlugin/WebXRSubsystem.cs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@
33
using AOT;
44
using UnityEngine;
55

6-
#if UNITY_2022_2_OR_NEWER || UNITY_2023_1_OR_NEWER
6+
#if UNITY_XR_MANAGEMENT_4_3_1_OR_NEWER
77
using UnityEngine.SubsystemsImplementation;
88
#endif
99

1010
namespace WebXR
1111
{
12-
#if UNITY_2022_2_OR_NEWER || UNITY_2023_1_OR_NEWER
13-
public class WebXRSubsystemDescriptor : SubsystemDescriptorWithProvider<WebXRSubsystem,WebXRSubsystemProvider>
14-
{
12+
#if UNITY_XR_MANAGEMENT_4_3_1_OR_NEWER
13+
public class WebXRSubsystemDescriptor : SubsystemDescriptorWithProvider<WebXRSubsystem, WebXRSubsystemProvider>
14+
{
1515
public WebXRSubsystemDescriptor()
1616
{
1717
providerType = typeof(WebXRSubsystem.Provider);
1818
}
19-
}
19+
}
2020

2121
public abstract class WebXRSubsystemProvider : SubsystemProvider<WebXRSubsystem> { }
22-
23-
public class WebXRSubsystem : SubsystemWithProvider<WebXRSubsystem,WebXRSubsystemDescriptor,WebXRSubsystemProvider>
24-
{
22+
23+
public class WebXRSubsystem : SubsystemWithProvider<WebXRSubsystem, WebXRSubsystemDescriptor, WebXRSubsystemProvider>
24+
{
2525
public class Provider : WebXRSubsystemProvider
2626
{
2727
public override void Start() { }
@@ -32,7 +32,8 @@ public override void Destroy() { }
3232
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
3333
private static void RegisterDescriptor()
3434
{
35-
SubsystemDescriptorStore.RegisterDescriptor(new WebXRSubsystemDescriptor() {
35+
SubsystemDescriptorStore.RegisterDescriptor(new WebXRSubsystemDescriptor()
36+
{
3637
id = typeof(WebXRSubsystem).FullName
3738
});
3839
}

Packages/webxr/Runtime/XRPlugin/XRSystemLifecycleManager.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
using UnityEngine;
33
using UnityEngine.XR.Management;
44

5-
#if UNITY_2022_2_OR_NEWER || UNITY_2023_1_OR_NEWER
5+
#if UNITY_XR_MANAGEMENT_4_3_1_OR_NEWER
66
using UnityEngine.SubsystemsImplementation;
77
#endif
88

99
namespace WebXR
1010
{
11-
#if UNITY_2022_2_OR_NEWER || UNITY_2023_1_OR_NEWER
11+
#if UNITY_XR_MANAGEMENT_4_3_1_OR_NEWER
1212
public class SubsystemLifecycleManager<TSubsystem, TSubsystemDescriptor,TProvider> : MonoBehaviour
13-
where TSubsystem : SubsystemWithProvider<TSubsystem, TSubsystemDescriptor,TProvider>, new()
14-
where TSubsystemDescriptor : SubsystemDescriptorWithProvider
15-
where TProvider : SubsystemProvider<TSubsystem>
13+
where TSubsystem : SubsystemWithProvider<TSubsystem, TSubsystemDescriptor,TProvider>, new()
14+
where TSubsystemDescriptor : SubsystemDescriptorWithProvider
15+
where TProvider : SubsystemProvider<TSubsystem>
1616
#else
1717
public class SubsystemLifecycleManager<TSubsystem, TSubsystemDescriptor> : MonoBehaviour
1818
where TSubsystem : Subsystem<TSubsystemDescriptor>

0 commit comments

Comments
 (0)