docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class XRPackageMetadataStore

    Provide access to the metadata store. Currently only usable as a way to assign and remove loaders to/from an XRManagerSettings instance.

    Inheritance
    object
    XRPackageMetadataStore
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEditor.XR.Management.Metadata
    Assembly: Unity.XR.Management.Editor.dll
    Syntax
    [InitializeOnLoad]
    public class XRPackageMetadataStore

    Methods

    AssignLoader(XRManagerSettings, string, BuildTargetGroup)

    Assigns a loader of type loaderTypeName to the settings instance. Will instantiate an instance if one can't be found in the users project folder before assigning it.

    Declaration
    public static bool AssignLoader(XRManagerSettings settings, string loaderTypeName, BuildTargetGroup buildTargetGroup)
    Parameters
    Type Name Description
    XRManagerSettings settings

    An instance of XRManagerSettings to add the loader to.

    string loaderTypeName

    The full type name for the loader instance to assign to settings.

    BuildTargetGroup buildTargetGroup

    The build target group being assigned to.

    Returns
    Type Description
    bool

    True if assignment succeeds, false if not.

    GetAllPackageMetadata()

    Return a read only list of all package metadata information currently known.

    Declaration
    public static IReadOnlyList<IXRPackage> GetAllPackageMetadata()
    Returns
    Type Description
    IReadOnlyList<IXRPackage>

    Read only list of IXRPackage.

    GetAllPackageMetadataForBuildTarget(BuildTargetGroup)

    Return a read only list of all package metadata information currently known that has loaders that support the given build.

    Declaration
    public static IReadOnlyList<IXRPackage> GetAllPackageMetadataForBuildTarget(BuildTargetGroup buildTargetGroup)
    Parameters
    Type Name Description
    BuildTargetGroup buildTargetGroup
    Returns
    Type Description
    IReadOnlyList<IXRPackage>

    Read only list of IXRPackage.

    GetMetadataForPackage(string)

    Given a package id, return the metadata for that package.

    Declaration
    public static IXRPackageMetadata GetMetadataForPackage(string packageId)
    Parameters
    Type Name Description
    string packageId

    The package id to check for.

    Returns
    Type Description
    IXRPackageMetadata

    An instance of IXRPackageMetadata if the package has metadata or null.

    IsLoaderAssigned(string, BuildTargetGroup)

    Given a loader type and a build target group will return whether or not that loader is currently assigned to be active for that build target.

    Declaration
    public static bool IsLoaderAssigned(string loaderTypeName, BuildTargetGroup buildTargetGroup)
    Parameters
    Type Name Description
    string loaderTypeName

    Loader type to check.

    BuildTargetGroup buildTargetGroup

    Build target group to check for assignment in.

    Returns
    Type Description
    bool

    RemoveLoader(XRManagerSettings, string, BuildTargetGroup)

    Remove a previously assigned loader from settings. If the loader type is unknown or an instance of the loader can't be found in the project folder no action is taken.

    Removal will not delete the instance from the project folder.

    Declaration
    public static bool RemoveLoader(XRManagerSettings settings, string loaderTypeName, BuildTargetGroup buildTargetGroup)
    Parameters
    Type Name Description
    XRManagerSettings settings

    An instance of XRManagerSettings to add the loader to.

    string loaderTypeName

    The full type name for the loader instance to remove from settings.

    BuildTargetGroup buildTargetGroup

    The build target group being removed from.

    Returns
    Type Description
    bool

    True if removal succeeds, false if not.

    In This Article
    Back to top
    Copyright © 2025 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)