Struct ApiLayers.ApiLayer
Contains information about an imported OpenXR API layer, including its enabled state and path. This struct is the primary representation of an API layer within the OpenXR settings.
Inherited Members
Namespace: UnityEngine.XR.OpenXR
Assembly: Unity.XR.OpenXR.dll
Syntax
[Serializable]
public struct ApiLayers.ApiLayer
Remarks
The ApiLayer struct represents a single OpenXR API layer that has been imported into your Unity project.
This struct contains metadata parsed from the layer's JSON manifest file.
The OpenXR runtime processes API layers in order to provide debugging, validation, or performance analysis capabilities.
Examples
This example shows how to check if a specific API layer is enabled:
ApiLayersFeature apiLayersFeature = OpenXRSettings.Instance.GetFeature<ApiLayersFeature>();
if (apiLayersFeature != null)
{
foreach (ApiLayers.ApiLayer layer in apiLayersFeature.apiLayers.collection)
{
if (layer.isEnabled)
{
Debug.Log($"Layer {layer.name} is enabled for {layer.libraryArchitecture}");
}
}
}
Properties
apiVersion
Gets the OpenXR API version supported by this layer.
Declaration
public string apiVersion { get; }
Property Value
| Type | Description |
|---|---|
| string |
See Also
description
Gets the description text for this API layer.
Declaration
public string description { get; }
Property Value
| Type | Description |
|---|---|
| string |
See Also
implementationVersion
Gets the implementation version of this API layer.
Declaration
public string implementationVersion { get; }
Property Value
| Type | Description |
|---|---|
| string |
See Also
isEnabled
Gets whether this API layer is enabled for use during runtime. An enabled layer will be included in the build and configured for the OpenXR loader.
Declaration
public bool isEnabled { get; }
Property Value
| Type | Description |
|---|---|
| bool |
See Also
libraryArchitecture
Gets the architecture for this API layer's library file.
Declaration
public Architecture libraryArchitecture { get; }
Property Value
| Type | Description |
|---|---|
| Architecture |
See Also
libraryPath
Gets the relative path to the API layer library file (e.g., a .dll or .so file).
Declaration
public string libraryPath { get; }
Property Value
| Type | Description |
|---|---|
| string |
See Also
name
Gets the display name of this API layer, as specified in its manifest.
Declaration
public string name { get; }
Property Value
| Type | Description |
|---|---|
| string |