docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class LoaderUtility

    A utility for interacting with an XRLoader from XR Management.

    Inheritance
    object
    LoaderUtility
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.XR.ARFoundation
    Assembly: Unity.XR.ARFoundation.dll
    Syntax
    public static class LoaderUtility
    Remarks

    XR Management controls the lifecycle of subsystems. Components in AR Foundation, such as ARSession or ARPlaneManager, turn subsystems on and off, but do not create or destroy them. Therefore, subsystems can persist across many scenes. They are automatically created on app startup, but are not destroyed during a scene switch. This allows you to keep the same session alive between scenes, for example.

    Methods

    Deinitialize()

    Deinitializes the currently active XR Loader, if one exists. This destroys all subsystems.

    Declaration
    public static bool Deinitialize()
    Returns
    Type Description
    bool

    Returns true if there is an active loader and its Deinitialize method returns true. Returns false otherwise.

    GetActiveLoader()

    Get the 'active' loader from XR Management.

    Declaration
    public static XRLoader GetActiveLoader()
    Returns
    Type Description
    XRLoader

    Returns the currently active XRLoader.

    Initialize()

    Initializes the currently active XR Loader, if one exists. This creates all subsystems.

    Declaration
    public static bool Initialize()
    Returns
    Type Description
    bool

    Returns true if there is an active loader and its Initialize method returns true. Returns false otherwise.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)