# ARCoreExtensions

ARCore Extensions, this script allows an app to specify and provide access to AR Foundation object instances that should be used by ARCore Extensions.

## Summary

### Inheritance

Inherits from: [`UnityEngine::MonoBehaviour`](https://docs.unity3d.com/ScriptReference/MonoBehaviour.html)

| ### Public attributes ||
|---|---|
| `https://developers.google.com/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARCoreExtensions#arcoreextensionsconfig` | `https://developers.google.com/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARCoreExtensionsConfig#classGoogle_1_1XR_1_1ARCoreExtensions_1_1ARCoreExtensionsConfig` Supplementary configuration to define features and options for the ARCore Extensions. |
| `https://developers.google.com/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARCoreExtensions#cameraconfigfilter` | `https://developers.google.com/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARCoreExtensionsCameraConfigFilter#classGoogle_1_1XR_1_1ARCoreExtensions_1_1ARCoreExtensionsCameraConfigFilter` The `https://developers.google.com/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARCoreExtensionsCameraConfigFilter#classGoogle_1_1XR_1_1ARCoreExtensions_1_1ARCoreExtensionsCameraConfigFilter` to define the set of properties desired or required by the app to run. |
| `https://developers.google.com/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARCoreExtensions#cameramanager` | `https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.2/api/UnityEngine.XR.ARFoundation.ARCameraManager.html` AR Foundation `ARCameraManager` used in the XROrigin. |
| `https://developers.google.com/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARCoreExtensions#onchoosexrcameraconfiguration` | `https://developers.google.com/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARCoreExtensions#onchoosexrcameraconfigurationevent` The callback event that allows a camera configuration to be selected from a list of valid configurations. |
| `https://developers.google.com/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARCoreExtensions#origin` | `XROrigin` AR Foundation `XROrigin` used by the scene. |
| `https://developers.google.com/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARCoreExtensions#session` | `https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.2/api/UnityEngine.XR.ARFoundation.ARSession.html` AR Foundation `ARSession` used by the scene. |

| ### Public functions ||
|---|---|
| `https://developers.google.com/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARCoreExtensions#awake()` | `void` Unity's Awake method. |
| `https://developers.google.com/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARCoreExtensions#onchoosexrcameraconfigurationevent(List< https://docs.unity3d.com/Packages/com.unity.xr.arsubsystems@4.2/api/UnityEngine.XR.ARSubsystems.XRCameraConfiguration.html > supportedConfigurations)` | `delegate int` Selects a camera configuration for the ARCore session to use. |
| `https://developers.google.com/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARCoreExtensions#ondestroy()` | `void` Unity's OnDestroy method. |
| `https://developers.google.com/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARCoreExtensions#ondisable()` | `void` Unity's OnDisable method. |
| `https://developers.google.com/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARCoreExtensions#onenable()` | `void` Unity's OnEnable method. |
| `https://developers.google.com/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARCoreExtensions#start()` | `void` Unity's Start method. |
| `https://developers.google.com/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARCoreExtensions#update()` | `void` Unity's Update method. |

## Public attributes

### ARCoreExtensionsConfig

```c#
ARCoreExtensionsConfig ARCoreExtensionsConfig
```
Supplementary configuration to define features and options for the ARCore Extensions.

### CameraConfigFilter

```c#
ARCoreExtensionsCameraConfigFilter CameraConfigFilter
```
The `https://developers.google.com/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARCoreExtensionsCameraConfigFilter#classGoogle_1_1XR_1_1ARCoreExtensions_1_1ARCoreExtensionsCameraConfigFilter` to define the set of properties desired or required by the app to run.

### CameraManager

```c#
ARCameraManager CameraManager
```
AR Foundation `ARCameraManager` used in the XROrigin.

### OnChooseXRCameraConfiguration

```c#
OnChooseXRCameraConfigurationEvent OnChooseXRCameraConfiguration
```
The callback event that allows a camera configuration to be selected from a list of valid configurations.

The callback should be registered before the ARCore session is enabled (e.g. Unity's [Awake()](https://developers.google.com/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARCoreExtensions#awake) method) to ensure it is triggered on the first frame update.

### Origin

```c#
XROrigin Origin
```
AR Foundation `XROrigin` used by the scene.

### Session

```c#
ARSession Session
```
AR Foundation `ARSession` used by the scene.

## Public functions

### Awake

```c#
void Awake()
```
Unity's Awake method.

### OnChooseXRCameraConfigurationEvent

```c#
delegate int OnChooseXRCameraConfigurationEvent(
  List< XRCameraConfiguration > supportedConfigurations
)
```
Selects a camera configuration for the ARCore session to use.


| Details ||
|---|---|
| Parameters | |---|---| | `supportedConfigurations` | A list of supported camera configurations. The size is dependent on `https://developers.google.com/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARCoreExtensions#cameraconfigfilter` settings. The GPU texture resolutions are the same in all configs. Currently, most devices provide GPU texture resolution of 1920 x 1080, but devices might provide higher or lower resolution textures, depending on device capabilities. The CPU image resolutions returned are VGA, 720p, and a resolution matching the GPU texture, typically the native resolution of the device. | |
| **Returns** | The index of the camera configuration in `supportedConfigurations` to be used for the ARCore session. If the return value is not a valid index (e.g. the value -1), then no camera configuration will be set and the ARCore session will use the previously selected camera configuration or a default configuration if no previous selection exists. |

### OnDestroy

```c#
void OnDestroy()
```
Unity's OnDestroy method.

### OnDisable

```c#
void OnDisable()
```
Unity's OnDisable method.

### OnEnable

```c#
void OnEnable()
```
Unity's OnEnable method.

### Start

```c#
void Start()
```
Unity's Start method.

### Update

```c#
void Update()
```
Unity's Update method.