Class XRPackageMetadataStore
Provide access to the metadata store. Currently only usable as a way to assign and remove loaders to/from an XRManagerSettings instance.
Namespace: UnityEditor.XR.Management.Metadata
Syntax
public class XRPackageMetadataStore : object
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 |
---|---|
Boolean | 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 |
---|---|
Boolean |
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 |
---|---|
Boolean | True if removal succeeds, false if not. |