Table of Contents

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

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

  1. 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]:

    Sense license

    • 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.

    Sense license information

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

    Sense license list

    Click Copy:

    Copy Sense license

  3. In the Unity editor, click [EasyAR] > [Mega] > [Configuration] in the 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 placement

    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 preparation (with .eif or .mkveif extension).

    Select EIF

  7. Hide Block Mesh.

    • You can set all Block Meshes to Hidden.

      Hide Block Mesh

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

      Change Alpha

      Drag the slider to the leftmost position.

  8. 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.