Class ARCameraFeature
Enables AR Foundation passthrough support via OpenXR for Android XR devices.
Inherited Members
Namespace: UnityEngine.XR.OpenXR.Features.Android
Assembly: Unity.XR.AndroidOpenXR.dll
Syntax
public class ARCameraFeature : AndroidXROpenXRFeature
Fields
featureId
The feature id string. This is used to give the feature an id for reference.
Declaration
public const string featureId = "com.unity.openxr.feature.arfoundation-androidxr-camera"
Field Value
| Type | Description |
|---|---|
| string |
Methods
GetValidationChecks(List<ValidationRule>, BuildTargetGroup)
Validation Rules for ARCameraFeature.
Declaration
protected override void GetValidationChecks(List<OpenXRFeature.ValidationRule> rules, BuildTargetGroup targetGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| List<OpenXRFeature.ValidationRule> | rules | |
| BuildTargetGroup | targetGroup |
Overrides
OnEnvironmentBlendModeChange(XrEnvironmentBlendMode)
Realigns environment blend mode with current passthrough state if they are misaligned after the mode was changed.
Declaration
protected override void OnEnvironmentBlendModeChange(XrEnvironmentBlendMode xrEnvironmentBlendMode)
Parameters
| Type | Name | Description |
|---|---|---|
| XrEnvironmentBlendMode | xrEnvironmentBlendMode | New environment blend mode value |
Overrides
OnSubsystemCreate()
Instantiates Android OpenXR Session subsystem instance, but does not start it. (Start/Stop is typically handled by AR Foundation managers.)
Declaration
protected override void OnSubsystemCreate()
Overrides
OnSubsystemDestroy()
Destroys the session subsystem.
Declaration
protected override void OnSubsystemDestroy()
Overrides
TryGetGlobalDimmingLevel()
Gets the current global passthrough dimming level applied by the runtime.
Declaration
public static Result<float> TryGetGlobalDimmingLevel()
Returns
| Type | Description |
|---|---|
| Result<float> | A result containing the current dimming intensity in the range [0.0, 1.0], where 0.0 represents no dimming (full passthrough brightness) and 1.0 represents maximum dimming (darkest passthrough). |
TryGetSupportedDimmingLevels(Allocator)
Gets the dimming levels supported by the runtime.
Declaration
public static Result<NativeArray<float>> TryGetSupportedDimmingLevels(Allocator allocator)
Parameters
| Type | Name | Description |
|---|---|---|
| Allocator | allocator | The allocator to use for the output array. |
Returns
| Type | Description |
|---|---|
| Result<NativeArray<float>> | A result containing a NativeArray_1 of floating-point values in the range [0.0, 1.0], where 0.0 represents no dimming (full brightness) and 1.0 represents maximum dimming. The caller is responsible for disposing the array when the result indicates success. On failure, the result value is default and does not require disposal. |
TryRequestGlobalDimmingLevel(float)
Requests the runtime to set the global passthrough dimming level.
Declaration
public static XRResultStatus TryRequestGlobalDimmingLevel(float dimmingLevel)
Parameters
| Type | Name | Description |
|---|---|---|
| float | dimmingLevel | Desired dimming intensity in the range [0.0, 1.0], where 0.0 represents no dimming (full passthrough brightness) and 1.0 represents maximum dimming (darkest passthrough). Values outside this range will be clamped. |
Returns
| Type | Description |
|---|---|
| XRResultStatus | Status indicating whether the request was accepted by the runtime. |
Remarks
A dimming level that doesn't map exactly to a supported level will be rounded to the closest one.