docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ApiLayersFeature

    Provides comprehensive OpenXR API layer support for debugging and development. This feature manages the runtime configuration of OpenXR API layers, handles platform environment setup, integrates with debug utilities, and invokes API layer support interface objects.

    Inheritance
    object
    Object
    ScriptableObject
    OpenXRFeature
    ApiLayersFeature
    Inherited Members
    OpenXRFeature.enabled
    OpenXRFeature.xrGetInstanceProcAddr
    OpenXRFeature.OnSubsystemCreate()
    OpenXRFeature.OnSubsystemStart()
    OpenXRFeature.OnSubsystemStop()
    OpenXRFeature.OnSubsystemDestroy()
    OpenXRFeature.OnSystemChange(ulong)
    OpenXRFeature.OnSessionCreate(ulong)
    OpenXRFeature.OnAppSpaceChange(ulong)
    OpenXRFeature.OnSessionStateChange(int, int)
    OpenXRFeature.OnSessionBegin(ulong)
    OpenXRFeature.OnSessionEnd(ulong)
    OpenXRFeature.OnSessionExiting(ulong)
    OpenXRFeature.OnSessionDestroy(ulong)
    OpenXRFeature.OnSessionLossPending(ulong)
    OpenXRFeature.OnInstanceLossPending(ulong)
    OpenXRFeature.OnFormFactorChange(int)
    OpenXRFeature.OnViewConfigurationTypeChange(int)
    OpenXRFeature.OnEnvironmentBlendModeChange(XrEnvironmentBlendMode)
    OpenXRFeature.OnEnabledChange()
    OpenXRFeature.PathToString(ulong)
    OpenXRFeature.StringToPath(string)
    OpenXRFeature.GetCurrentInteractionProfile(ulong)
    OpenXRFeature.GetCurrentInteractionProfile(string)
    OpenXRFeature.GetCurrentAppSpace()
    OpenXRFeature.GetViewConfigurationTypeForRenderPass(int)
    OpenXRFeature.SetEnvironmentBlendMode(XrEnvironmentBlendMode)
    OpenXRFeature.GetEnvironmentBlendMode()
    OpenXRFeature.CreateSubsystem<TDescriptor, TSubsystem>(List<TDescriptor>, string)
    OpenXRFeature.StartSubsystem<T>()
    OpenXRFeature.StopSubsystem<T>()
    OpenXRFeature.DestroySubsystem<T>()
    OpenXRFeature.OnEnable()
    OpenXRFeature.OnDisable()
    OpenXRFeature.Awake()
    OpenXRFeature.GetAction(InputAction)
    OpenXRFeature.GetAction(InputDevice, InputFeatureUsage)
    OpenXRFeature.GetAction(InputDevice, string)
    OpenXRFeature.RegisterStatsDescriptor(string, OpenXRFeature.StatFlags)
    OpenXRFeature.SetStatAsFloat(ulong, float)
    OpenXRFeature.SetStatAsUInt(ulong, uint)
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(string)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.InstantiateAsync<T>(T)
    Object.InstantiateAsync<T>(T, Transform)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int)
    Object.InstantiateAsync<T>(T, int, Transform)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, InstantiateParameters)
    Object.InstantiateAsync<T>(T, int, InstantiateParameters)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion, InstantiateParameters)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion, InstantiateParameters)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>, InstantiateParameters)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Scene)
    Object.Instantiate<T>(T, InstantiateParameters)
    Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.OpenXR.Features
    Assembly: Unity.XR.OpenXR.dll
    Syntax
    public class ApiLayersFeature : OpenXRFeature
    Remarks

    Enable this feature in your OpenXR settings to activate API layer support in your application. The ApiLayersFeature manages the lifecycle of API layers, configuring them before the OpenXR instance is created and cleaning them up on instance destruction. It also provides a registration system for ISupport implementations that need to perform custom setup and teardown operations. API layers execute in the order they appear in the collection.

    Examples

    This example demonstrates how to programmatically access and configure API layers at runtime: OpenXRSettings settings = OpenXRSettings.GetSettingsForBuildTargetGroup(BuildTargetGroup.Standalone); ApiLayersFeature apiLayersFeature = settings.GetFeature<ApiLayersFeature>(); if (apiLayersFeature != null && apiLayersFeature.enabled) { // Enable core validation layer for x64 architecture apiLayersFeature.apiLayers.SetEnabled("XR_APILAYER_LUNARG_core_validation", Architecture.X64, true); Debug.Log($"API layers configured: {apiLayersFeature.apiLayers.collection.Count} layers available"); }

    Fields

    featureId

    A unique identifier for this feature.

    Declaration
    public const string featureId = "com.unity.openxr.feature.apilayers"
    Field Value
    Type Description
    string
    See Also
    ApiLayers
    ApiLayers.ISupport
    DebugUtilsFeature

    Properties

    apiLayers

    Gets the API layers instance for this feature configuration.

    Declaration
    public ApiLayers apiLayers { get; }
    Property Value
    Type Description
    ApiLayers
    See Also
    ApiLayers
    ApiLayers.ISupport
    DebugUtilsFeature

    Methods

    AddSupport(ISupport)

    Registration method for support objects.

    Declaration
    public static void AddSupport(ApiLayers.ISupport support)
    Parameters
    Type Name Description
    ApiLayers.ISupport support

    The support object to add.

    See Also
    ApiLayers
    ApiLayers.ISupport
    DebugUtilsFeature

    GetValidationChecks(List<ValidationRule>, BuildTargetGroup)

    Allows a feature to add to a list of validation rules which your feature will evaluate at build time. Details of the validation results can be found in OpenXRProjectValidation.

    Declaration
    protected override void GetValidationChecks(List<OpenXRFeature.ValidationRule> rules, BuildTargetGroup targetGroup)
    Parameters
    Type Name Description
    List<OpenXRFeature.ValidationRule> rules

    Your feature will check the rules in this list at build time. Add rules that you want your feature to check, and remove rules that you want your feature to ignore.

    BuildTargetGroup targetGroup

    Build target group these validation rules will be evaluated for.

    Overrides
    OpenXRFeature.GetValidationChecks(List<OpenXRFeature.ValidationRule>, BuildTargetGroup)
    See Also
    ApiLayers
    ApiLayers.ISupport
    DebugUtilsFeature

    HookGetInstanceProcAddr(IntPtr)

    Hooks into the OpenXR instance creation process to configure API layers and the environment. This method is called before the OpenXR instance is created.

    Declaration
    protected override IntPtr HookGetInstanceProcAddr(IntPtr hookGetInstanceProcAddr)
    Parameters
    Type Name Description
    IntPtr hookGetInstanceProcAddr

    The original GetInstanceProcAddr function pointer.

    Returns
    Type Description
    IntPtr

    The original function pointer.

    Overrides
    OpenXRFeature.HookGetInstanceProcAddr(IntPtr)
    See Also
    ApiLayers
    ApiLayers.ISupport
    DebugUtilsFeature

    OnInstanceCreate(ulong)

    Called after the OpenXR instance is successfully created.

    Declaration
    protected override bool OnInstanceCreate(ulong xrInstance)
    Parameters
    Type Name Description
    ulong xrInstance

    The handle to the created OpenXR instance.

    Returns
    Type Description
    bool

    True if initialization was successful, false otherwise.

    Overrides
    OpenXRFeature.OnInstanceCreate(ulong)
    See Also
    ApiLayers
    ApiLayers.ISupport
    DebugUtilsFeature

    OnInstanceDestroy(ulong)

    Called when the OpenXR instance is being destroyed. This method triggers the teardown process for all support classes.

    Declaration
    protected override void OnInstanceDestroy(ulong xrInstance)
    Parameters
    Type Name Description
    ulong xrInstance

    The handle of the OpenXR instance being destroyed.

    Overrides
    OpenXRFeature.OnInstanceDestroy(ulong)
    See Also
    ApiLayers
    ApiLayers.ISupport
    DebugUtilsFeature

    RemoveSupport(ISupport)

    De-registration method for support objects.

    Declaration
    public static void RemoveSupport(ApiLayers.ISupport support)
    Parameters
    Type Name Description
    ApiLayers.ISupport support

    The support object to remove.

    See Also
    ApiLayers
    ApiLayers.ISupport
    DebugUtilsFeature

    See Also

    ApiLayers
    ApiLayers.ISupport
    DebugUtilsFeature
    In This Article
    Back to top
    Copyright © 2026 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)