Table of Contents

Simulate running in the Unity editor

This document will guide you through simulating real-world location scenarios in the Unity editor, helping you complete static alignment checks for virtual content before the mini-program goes live.

Before you begin

Important

Using on-site recorded EIF data allows for intuitive verification of whether the placement of virtual content 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.

Simulation run

  1. Create a Sense License

    Since EasyAR Sense is required for simulation runs on Unity, you need to 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]:

    Sense License

    • Select EasyAR Sense Personal Edition.

    • In the 'Use Sparse Spatial Map' option, select 'No'.

    • Fill in any application name, iOS Bundle ID, and Android Package Name.

    • Click OK. The applied license will then appear in the Sense License Management section of the Developer Center.

    Sense License Info

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

    Sense License List

    Click Copy:

    Sense License Copy

  3. Click [EasyAR] > [Mega] > [Configuration] in the Unity editor's top menu bar to enter the configuration page:

    Configuration

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

    Fill in Sense License

  5. Enable the verification tool and click Run.

    Completed Scene Setup

    Click OK in the pop-up window.

    Pop-up Window

  6. Click the Load Button to load the EIF file.

    Load Button

    Select the EIF file saved during the preparation work (with the extension .eif or .mkveif).

    Select EIF

  7. Hide Block Mesh.

    • You can set all Block Meshes to Hidden.

      Hide Block Mesh

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

      Change Alpha

      Drag the control bar to the far left.

  8. Play EIF

Important

When playing EIF in the Unity editor, the SDK and input frame data used are different from those used by the xr-frame mini-program. Therefore, this method:

✅ Can be used to visually verify whether the placement of virtual content is accurate and to verify the positioning accuracy of the cloud positioning service at that location.

❌ Cannot be used to verify the final effect of the xr-frame mini-program in actual device operation.

Working principle and expectations: When playing EIF data in Unity, the EasyAR SDK will call the recorded input frame data and send a real cloud request to the configured positioning service.

  • If positioning is successful and stable: The model position is accurate and does not drift, which indicates that the scene can achieve an ideal effect in the xr-frame mini-program.

  • If positioning fails or behaves abnormally: The model frequently jumps, shifts, or cannot be positioned, which usually means the xr-frame mini-program will face similar issues during actual device operation.