Class XRManagerSettings
Class to handle active loader and subsystem management for XR. This class is to be added as a
ScriptableObject asset in your project and should only be referenced by the XRGeneral
Given a list of loaders, it will attempt to load each loader in the given order. The first
loader that is successful wins and all remaining loaders are ignored. The loader
that succeeds is accessible through the active
Depending on configuration the XRManager
Disabling automatic
Automatic lifecycle management is executed as follows
- Runtime Initialize -> Initialize
Loader() . The loader list will be iterated over and the first successful loader will be set as the active loader. - Start -> Start
Subsystems() . Ask the active loader to start all subsystems. - OnDisable -> Stop
Subsystems() . Ask the active loader to stop all subsystems. - OnDestroy -> Deinitialize
Loader() . Deinitialize and remove the active loader.
Inherited Members
Namespace: UnityEngine .XR.Management
Assembly: solution.dll
Syntax
public sealed class XRManagerSettings : ScriptableObject
Properties
Name | Description |
---|---|
active |
Return the current singleton active loader instance. |
active |
A shallow copy of the list of loaders currently managed by this XR Manager instance. |
automatic |
Get and set Automatic Loading state for this manager. When this is true, the manager will automatically call
Initialize |
automatic |
Get and set automatic running state for this manager. When set to true the manager will call Start |
is |
Read only boolean letting us know if initialization is completed. Because initialization is handled as a Coroutine, people taking advantage of the auto-lifecycle management of XRManager will need to wait for init to complete before checking for an ActiveLoader and calling StartSubsystems. |
loaders | List of loaders currently managed by this XR Manager instance. |
Methods
Name | Description |
---|---|
Active |
Return the current active loader, cast to the requested type. Useful shortcut when you need to get the active loader as something less generic than XRLoader. |
Deinitialize |
If there is an active loader, this function will deinitialize it and remove the active loader instance from
management. We will automatically call Stop You must wait for is Upon return is |
Initialize |
Iterate over the configured list of loaders and attempt to initialize each one. The first one that succeeds is set as the active loader and initialization immediately terminates. When complete is Note that there can only be one active loader. Any attempt to initialize a new active loader with one already set will cause a warning to be logged and immediate exit of this function. Iteration is done asynchronously and this method must be called within the context of a Coroutine. If manual initialization of XR is being done, this method can not be called before Start completes as it depends on graphics initialization within Unity completing. |
Initialize |
Iterate over the configured list of loaders and attempt to initialize each one. The first one that succeeds is set as the active loader and initialization immediately terminates. When complete is Note that there can only be one active loader. Any attempt to initialize a new active loader with one already set will cause a warning to be logged and immediate exit of this function. This method is synchronous and on return all state should be immediately checkable. If manual initialization of XR is being done, this method can not be called before Start completes as it depends on graphics initialization within Unity completing. |
Start |
If there is an active loader, this will request the loader to start all the subsystems that it is managing. You must wait for is |
Stop |
If there is an active loader, this will request the loader to stop all the subsystems that it is managing. You must wait for is |
Try |
Attempts to append the given loader to the list of loaders at the given index. |
Try |
Attempts to remove the first instance of a given loader from the list of loaders. |
Try |
Attempts to set the given loader list as the list of loaders managed by this instance. |