# XRAnchorFeature

This OpenXRInteractionFeature configures new extensions `XR_ANDROID_trackables` and `XR_ANDROID_device_anchor_persistence` at runtime and provides XRAnchorSubsystem implementation that works on Android XR platform.

Note: due to the dependency on [XRSessionFeature](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRSessionFeature#classGoogle_1_1XR_1_1Extensions_1_1XRSessionFeature) and [XRTrackableFeature](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRTrackableFeature#classGoogle_1_1XR_1_1Extensions_1_1XRTrackableFeature), its priority must be lower than session and trackable features so the feature registration happens after `XrInstanceManager` and `XrTrackableProvider` creation.

## Summary

### Inheritance

Inherits from: `OpenXRFeature`

|                                                                                                                                                                ### Public attributes                                                                                                                                                                ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|
| [ExtensionStrings](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRAnchorFeature#extensionstrings)` = "XR_ANDROID_trackables " + "XR_ANDROID_device_anchor_persistence"` | `const string` The OpenXR Extension string.                                                                                         |
| [FeatureId](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRAnchorFeature#featureid)` = "com.google.xr.extensions.anchor"`                                               | `const string` The feature ID string.                                                                                               |
| [PersistentExtensionString](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRAnchorFeature#persistentextensionstring)` = "XR_ANDROID_device_anchor_persistence"`          | `const string` The OpenXR extensions for persistence feature.                                                                       |
| [UiName](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRAnchorFeature#uiname)` = "Android XR (Extensions): Anchor"`                                                     | `const string` The UI name shows on the XR Plug-in Management panel, help users to understand validation errors and expected fixes. |

|                                                                                                                                                                                      ### Public static attributes                                                                                                                                                                                       ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [IsExtensionEnabled](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRAnchorFeature#isextensionenabled)` => _extensionEnabled`                           | `bool` Gets if the required OpenXR extension is enabled.                                                                                                                                                 |
| [RequiredPermission](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRAnchorFeature#requiredpermission)` = AndroidXRPermission.SceneUnderstandingCoarse` | `readonly `[AndroidXRPermission](https://developer.android.com/develop/xr/unity/reference/namespace/Google/XR/Extensions#androidxrpermission) Runtime permission required to enable scene understanding. |

|                                                                                                   ### Properties                                                                                                    ||
|--------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------|
| [UsePersistence](https://developer.android.com/develop/xr/unity/reference/class/Google/XR/Extensions/XRAnchorFeature#usepersistence) | `bool` Gets or sets a value indicating whether to use persistence at runtime. |

## Public attributes

### ExtensionStrings

```c#
const string ExtensionStrings =
            "XR_ANDROID_trackables " +
            "XR_ANDROID_device_anchor_persistence"
```  
The OpenXR Extension string.

Used to check if this extensions is available or enabled. To enable runtime confiugration, always enabling persistence extension when it's available.  

### FeatureId

```c#
const string FeatureId = "com.google.xr.extensions.anchor"
```  
The feature ID string.  

### PersistentExtensionString

```c#
const string PersistentExtensionString = "XR_ANDROID_device_anchor_persistence"
```  
The OpenXR extensions for persistence feature.

Used to check if this extensions is available or enabled.  

### UiName

```c#
const string UiName = "Android XR (Extensions): Anchor"
```  
The UI name shows on the XR Plug-in Management panel, help users to understand validation errors and expected fixes.

## Public static attributes

### IsExtensionEnabled

```c#
bool IsExtensionEnabled => _extensionEnabled
```  
Gets if the required OpenXR extension is enabled.

When OpenXR runtime is waiting, it returns `null`. Otherwise, it indicates whether the XR_ANDROID_trackables extension is available on current device.  

### RequiredPermission

```c#
readonly AndroidXRPermission RequiredPermission =
            AndroidXRPermission.SceneUnderstandingCoarse
```  
Runtime permission required to enable scene understanding.

## Properties

### UsePersistence

```c#
bool UsePersistence
```  
Gets or sets a value indicating whether to use persistence at runtime.