docs.unity3d.com
    Show / Hide Table of Contents

    Class 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.

    Inheritance
    Object
    XRLoader
    XRLoaderHelper
    Namespace: UnityEngine.XR.Management
    Syntax
    public abstract class XRLoader : ScriptableObject

    Methods

    Deinitialize()

    Ask loader to deinitialize all initialized subsystems.

    Declaration
    public virtual bool Deinitialize()
    Returns
    Type Description
    Boolean

    Whether or not deinitialization succeeded.

    GetLoadedSubsystem<T>()

    Gets the loaded subsystem of the specified type. Implementation dependent as only implemetnations know what they have loaded and how best to get it..

    Declaration
    public abstract T GetLoadedSubsystem<T>()
        where T : class, ISubsystem
    Returns
    Type Description
    T

    The loaded subsystem or null if not found.

    Type Parameters
    Name Description
    T

    Type of the subsystem to get

    GetSupportedGraphicsDeviceTypes(Boolean)

    Gets the loader's supported graphics device types. If the list is empty, it is assumed that it supports all graphics device types.

    Declaration
    public virtual List<GraphicsDeviceType> GetSupportedGraphicsDeviceTypes(bool buildingPlayer)
    Parameters
    Type Name Description
    Boolean buildingPlayer

    True if the player is being built. You may want to include or exclude graphics apis if the player is being built or not.

    Returns
    Type Description
    List<GraphicsDeviceType>

    Returns the loader's supported graphics device types.

    Initialize()

    Initialize the loader. This should initialize all subsystems to support the desired runtime setup this loader represents.

    This is the only method on XRLoader that Management uses to determine the active loader to use. If this method returns true, Management locks this loader as the activeLoader and and stops fall through processing on the loaders list of current loaders.

    If this method returns false, XRManagerSettings continues to process the next loader in the loaders list, or fails completely when the list is exhausted.

    Declaration
    public virtual bool Initialize()
    Returns
    Type Description
    Boolean

    Whether or not initialization succeeded.

    Start()

    Ask loader to start all initialized subsystems.

    Declaration
    public virtual bool Start()
    Returns
    Type Description
    Boolean

    Whether or not all subsystems were successfully started.

    Stop()

    Ask loader to stop all initialized subsystems.

    Declaration
    public virtual bool Stop()
    Returns
    Type Description
    Boolean

    Whether or not all subsystems were successfully stopped.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023