EasyARSettings.UnityXROptions Class

Description

Configuration options related to the Unity XR Framework.


Classes

public class EasyARSettings.UnityXROptions.AutoSwitchOptions

Options to auto switch Unity XR (like AR Foundation) objects.


Fields

ARFoundationSupport

C#

public bool ARFoundationSupport

EasyAR AR Foundation Support. It is recommended to keep this enabled; otherwise, EasyAR may not work properly with AR Foundation. Disable only if a future AR Foundation update causes incompatibility and EasyAR has not yet provided an update.

UnityXRAutoSwitch

C#

public EasyARSettings.UnityXROptions.AutoSwitchOptions UnityXRAutoSwitch

Auto switch Unity XR (like AR Foundation) objects. This option is primarily designed for mobile AR. On head-mounted devices, the feature will be disabled by default.

If you need to manually control the switching of these components, or if EasyAR’s behavior interferes with the normal operation of certain components, make sure to disable these options.

You need to add ARSession and XR Origin to your scene using its context menu when you need to switch AR Foundation automatically in runtime, and use camera from AR Foundation.

In play mode, the ARSession will disable all Unity XR Core components and all AR Foundation components on awake.

In play mode, if the selected frame source is derived from ARFoundationFrameSource or ExternalDeviceFrameSource using XROrigin, all disabled Unity XR Core components and AR Foundation components (not including those not disabled by EasyAR) will be enabed in ARSession.StartSession . If other frame source is selected, all Unity XR Core components and AR Foundation components will be disabled in ARSession.StartSession .

In play mode, all Unity XR Core components and all AR Foundation components will be disabled in ARSession.StopSession .

Please notices that XR Interaction Toolkit components are not under control of this option, and whether they can work with EasyAR is unverified. Theoretically, compoents use only XROrigin GameObject and its camera can work, but you may need to set ARSession.CenterMode to ARSession.ARCenterMode.SessionOrigin . If the components are not functional, you need to control XR Interaction Toolkit componets, and disable them when frame source is not derived from ARFoundationFrameSource .