Namespace UnityEngine.XR.Management
Classes
XRConfigurationDataAttribute
This attribute is used to tag classes as providing build settings support for an XR provider. The unified setting system will present the settings as an inspectable object in the Unified Settings window using the built-in inspector UI.
The implementor of the settings is able to create their own custom UI and the Unified Settings system will use that UI in place of the build in inspector. See the <a href="https://docs.unity3d.com/Manual/ExtendingTheEditor.html">>Extending the Editor</a> portion of the Unity documentation for information and instructions on doing this.
XRGeneralSettings
General settings container used to house the instance of the active settings as well as the manager instance used to load the loaders with.
XRLoader
XR Loader abstract class used as a base class for specific provider implementations. Providers should implement subclasses of this to provide specific initialization and management implementations that make sense for their supported scenarios and needs.
XRLoaderHelper
XR Loader abstract subclass used as a base class for specific provider implementations. Class provides some helper logic that can be used to handle subsystem handling in a typesafe manner, reducing potential boilerplate code.
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 XRGeneralSettings instance for its use.
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 activeLoader property on the manager.
Depending on configuration the XRManagerSettings instance will automatically manage the active loader at correct points in the application lifecycle. The user can override certain points in the active loader lifecycle and manually manage them by toggling the automaticLoading and automaticRunning properties. Disabling automaticLoading implies the the user is responsible for the full lifecycle of the XR session normally handled by the XRManagerSettings instance. Toggling this to false also toggles automaticRunning false.
Disabling automaticRunning only implies that the user is responsible for starting and stopping the activeLoader through the StartSubsystems() and StopSubsystems() APIs.
Automatic lifecycle management is executed as follows
- Runtime Initialize -> InitializeLoader(). The loader list will be iterated over and the first successful loader will be set as the active loader.
- Start -> StartSubsystems(). Ask the active loader to start all subsystems.
- OnDisable -> StopSubsystems(). Ask the active loader to stop all subsystems.
- OnDestroy -> DeinitializeLoader(). Deinitialize and remove the active loader.
Interfaces
IXRLoaderPreInit
XRLoader interface for retrieving the XR PreInit library name from an XRLoader instance