Simulate runtime in the Unity editor
This document guides you through simulating real-world localization in the Unity editor, helping you complete static alignment checks for virtual content before your mini-program goes live.
Before you begin
Able to use Mega Studio in Unity.
Use the Mega Toolbox tool to collect simulation data.
Create 3D content aligned with the real world, for example:

Important
Using on-site recorded EIF data allows intuitive verification of whether virtual content placement is accurate.
However, due to differences between the xr-frame and Unity platform environments, code script logic and rendering results cannot be verified during simulation.
Simulate runtime
Create a Sense license
Since simulating in Unity requires EasyAR Sense, prepare a Sense license (it can be a trial version).
In the EasyAR Developer Center, select [Sense License Management] > [Create a new Sense License Key]:

- Select EasyAR Sense Personal Edition.
- Choose 'No' for the 'Use Sparse Spatial' option.
- Fill in any application name, iOS Bundle ID, and Android Package Name.
- Click OK. The applied license will appear in Sense License Management.

In the EasyAR Developer Center, select the Sense license applied in the preparation work.

Click Copy:

In the Unity editor, click [EasyAR] > [Mega] > [Configuration] in the top menu bar to enter the configuration page:

Click Sense on the left to configure, and fill in the Sense License.

Enable the verification tool and click Run.

Click OK in the pop-up window.

Click the Load button to load the EIF file.

Select the EIF file saved during preparation (with
.eifor.mkveifextension).
Hide Block Mesh.
You can set all Block Meshes to Hidden.

You can set Block Mesh Alpha to 0 (transparent) in the verification tool.

Drag the slider to the leftmost position.
Play EIF
Important
When playing EIF in the Unity editor, the SDK and input frame data used differ from those in the xr-frame mini-program. Therefore:
✅ Can be used to visually verify the placement accuracy of virtual content and the localization accuracy of the cloud localization service at that location.
❌ Cannot be used to verify the final effect of xr-frame mini-program on actual devices.
How it works and expectations: When playing EIF data in Unity, the EasyAR SDK calls the recorded input frame data and sends real cloud requests to the configured localization service.
If localization succeeds and performs stably: Models are accurately positioned without drift, indicating the xr-frame mini-program should achieve similar results.
If localization fails or behaves abnormally: Models exhibit frequent jumping, offset, or failure to locate, usually indicating similar issues will occur during actual xr-frame mini-program runtime.