@@ -17,11 +17,21 @@ public WebXRSubsystemDescriptor()
17
17
providerType = typeof ( WebXRSubsystem . Provider ) ;
18
18
}
19
19
}
20
+ #else
21
+ public class WebXRSubsystemDescriptor : SubsystemDescriptor < WebXRSubsystem >
22
+ {
23
+ }
24
+ #endif
20
25
26
+ #if UNITY_XR_MANAGEMENT_4_3_1_OR_NEWER
21
27
public abstract class WebXRSubsystemProvider : SubsystemProvider < WebXRSubsystem > { }
22
28
23
29
public class WebXRSubsystem : SubsystemWithProvider < WebXRSubsystem , WebXRSubsystemDescriptor , WebXRSubsystemProvider >
30
+ #else
31
+ public class WebXRSubsystem : Subsystem < WebXRSubsystemDescriptor >
32
+ #endif
24
33
{
34
+ #if UNITY_XR_MANAGEMENT_4_3_1_OR_NEWER
25
35
public class Provider : WebXRSubsystemProvider
26
36
{
27
37
public override void Start ( ) { }
@@ -37,8 +47,22 @@ private static void RegisterDescriptor()
37
47
id = typeof ( WebXRSubsystem ) . FullName
38
48
} ) ;
39
49
}
50
+ #else
51
+ [ RuntimeInitializeOnLoadMethod ( RuntimeInitializeLoadType . SubsystemRegistration ) ]
52
+ private static void RegisterDescriptor ( )
53
+ {
54
+ var res = SubsystemRegistration . CreateDescriptor ( new WebXRSubsystemDescriptor ( )
55
+ {
56
+ id = typeof ( WebXRSubsystem ) . FullName ,
57
+ subsystemImplementationType = typeof ( WebXRSubsystem )
58
+ } ) ;
59
+ if ( res )
60
+ Debug . Log ( "Registered " + nameof ( WebXRSubsystemDescriptor ) ) ;
61
+ else Debug . Log ( "Failed registering " + nameof ( WebXRSubsystemDescriptor ) ) ;
62
+ }
63
+ #endif
40
64
41
- internal static WebXRSubsystem Instance ;
65
+ #if UNITY_XR_MANAGEMENT_4_3_1_OR_NEWER
42
66
protected override void OnStart ( )
43
67
{
44
68
if ( Instance != null ) return ;
@@ -61,25 +85,6 @@ protected override void OnDestroy()
61
85
Instance = null ;
62
86
}
63
87
#else
64
- public class WebXRSubsystemDescriptor : SubsystemDescriptor < WebXRSubsystem >
65
- {
66
- }
67
-
68
- public class WebXRSubsystem : Subsystem < WebXRSubsystemDescriptor >
69
- {
70
- [ RuntimeInitializeOnLoadMethod ( RuntimeInitializeLoadType . SubsystemRegistration ) ]
71
- private static void RegisterDescriptor ( )
72
- {
73
- var res = SubsystemRegistration . CreateDescriptor ( new WebXRSubsystemDescriptor ( )
74
- {
75
- id = typeof ( WebXRSubsystem ) . FullName ,
76
- subsystemImplementationType = typeof ( WebXRSubsystem )
77
- } ) ;
78
- if ( res )
79
- Debug . Log ( "Registered " + nameof ( WebXRSubsystemDescriptor ) ) ;
80
- else Debug . Log ( "Failed registering " + nameof ( WebXRSubsystemDescriptor ) ) ;
81
- }
82
-
83
88
public override void Start ( )
84
89
{
85
90
if ( running ) return ;
@@ -107,8 +112,6 @@ protected override void OnDestroy()
107
112
108
113
private bool _running ;
109
114
public override bool running => _running ;
110
-
111
- private static WebXRSubsystem Instance ;
112
115
#endif
113
116
private void UpdateControllersOnEnd ( )
114
117
{
@@ -220,6 +223,11 @@ private void UpdateXRCameras()
220
223
}
221
224
}
222
225
226
+ //private bool _running;
227
+ //public override bool running => _running;
228
+
229
+ private static WebXRSubsystem Instance ;
230
+
223
231
internal void InternalStart ( )
224
232
{
225
233
#if UNITY_WEBGL
0 commit comments