Enable headset support in EasyAR project
This document explains how to enable headset support in an existing EasyAR Unity scene.
Before you begin
- Read EasyAR Headset Support to learn about the types of headsets supported by EasyAR and the EasyAR features that can run on headsets.
- Read EasyAR Headset Support in Unity to understand the overall architecture of EasyAR headset support in Unity.
This article assumes you already have a scene that can use EasyAR. If you need to create such a scene or add EasyAR components to a headset scene, refer to the following documents:
Add the headset component to the scene
Before adding the headset component to the scene, you usually need to remove the existing Camera and XR Origin.
Remove camera and XR origin
Delete the existing Camera in the scene.

If the scene already contains XR Origin, whether it comes from EasyAR or the Unity XR framework, in most cases it needs to be deleted.

Tip
In some advanced usage scenarios, you can decide whether to delete it based on your needs.
Add headset components
Follow the official headset instructions to add headset components. Here, we take the Pico headset as an example. In case of any conflict with the official instructions, the official instructions shall prevail.
Use the menu to add an XR Interaction Manager:

Use the menu to add an XR Origin:

Before running, make sure to read the official headset instructions to understand how a scene with a headset SDK should be configured and run.
Configure frame source
Built-in supported devices
Select AR Session (EasyAR) and right-click, then use the menu EasyAR Sense > Head Mounted Display (Built-in) > Frame Source : [Name] (keep it only) to create a frame source for [Name] and keep only it.
For example, to configure the frame source for Apple Vision Pro:

After the operation, the frame source in the session will look like this:

Tip
If the session contains the corresponding frame source for the device and it is the first available frame source on the device (for example, in the above image, VisionOS ARKit is the first available frame source in the visionOS system), no modification is needed. Some default sessions created via the menu fall into this category.
Extend supported devices
Select AR Session (EasyAR) and right-click, then create a frame source for [Name] and keep it only via the menu EasyAR Sense > Extensions > Frame Source : [Name] (keep it only).
For example, to configure the frame source for Pico headset:

After the operation, the frame source in the session will look like this:

Cross-device support
If the scenario needs to run on different devices, it is necessary to retain other frame sources and ensure that the current frame source of the device can be selected.
Using menu items without (keep it only) can add a frame source without deleting other frame sources. For example, EasyAR Sense > Extensions > Frame Source : Pico will create a frame source suitable for Pico at the end of all frame sources in the session. Generally, after adding a frame source in this way, it also needs to be moved to the appropriate position.
Tip
In some advanced usage scenarios, you can adjust the position of the frame source as needed or modify it in the code.