Class XRSubsystem<TSubsystem, TSubsystemDescriptor, TProvider>
Base class for subsystems that enables asynchronous start and the ability to automatically request required permissions on any platform.
Inheritance
SubsystemWithProvider<TSubsystem, TSubsystemDescriptor, TProvider>
XRSubsystem<TSubsystem, TSubsystemDescriptor, TProvider>
Implements
Inherited Members
SubsystemWithProvider<TSubsystem, TSubsystemDescriptor, TProvider>.OnCreate()
SubsystemWithProvider<TSubsystem, TSubsystemDescriptor, TProvider>.OnStart()
SubsystemWithProvider<TSubsystem, TSubsystemDescriptor, TProvider>.OnStop()
SubsystemWithProvider<TSubsystem, TSubsystemDescriptor, TProvider>.OnDestroy()
SubsystemWithProvider<TSubsystem, TSubsystemDescriptor, TProvider>.subsystemDescriptor
SubsystemWithProvider<TSubsystem, TSubsystemDescriptor, TProvider>.provider
SubsystemWithProvider.OnStart()
SubsystemWithProvider.OnStop()
SubsystemWithProvider.OnDestroy()
Namespace: UnityEngine.XR.ARSubsystems
Assembly: Unity.XR.ARSubsystems.dll
Syntax
public class XRSubsystem<TSubsystem, TSubsystemDescriptor, TProvider> : SubsystemWithProvider<TSubsystem, TSubsystemDescriptor, TProvider>, ISubsystem where TSubsystem : SubsystemWithProvider, new() where TSubsystemDescriptor : SubsystemDescriptorWithProvider where TProvider : SubsystemProvider<TSubsystem>
Type Parameters
| Name | Description |
|---|---|
| TSubsystem | The subsystem type. |
| TSubsystemDescriptor | The subsystem descriptor type. |
| TProvider | The subsystem provider type. |
Methods
GetPermissionState()
Get the state of any required permissions for this subsystem to run on the current device.
Declaration
public virtual XRPermissionState GetPermissionState()
Returns
| Type | Description |
|---|---|
| XRPermissionState | The permission state. |
TryStartAsync(CancellationToken, XRSubsystemStartOptions)
Attempts to start the subsystem with the given options.
Declaration
public virtual Awaitable<XRResultStatus> TryStartAsync(CancellationToken token = default, XRSubsystemStartOptions options = XRSubsystemStartOptions.None)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | token | An optional cancellation token, which you can use to cancel the operation in progress. |
| XRSubsystemStartOptions | options | The start options. |
Returns
| Type | Description |
|---|---|
| Awaitable<XRResultStatus> | A status representing whether the subsystem was successfully started, and any applicable error codes from the runtime. |