Create and Upload Annotations Using the Unity Editor
This article explains how to create and upload annotations using Mega Studio in the Unity Editor.
Before you begin
Be able to use Mega Studio in Unity
Prepare the model: Use the model from the sample project (a cute panda) or the small robot model from the xr-frame official Demo, or refer to XRFame Loadable GLTF Formats and Supported Extensions to prepare a model file that meets xr-frame requirements.
Import the model file into Unity.
Tip
The Mega plugin has already added a dependency on com.unity.cloud.gltfast, so you can directly drag the model file into Unity Assets.
Why annotations are needed
EasyAR Mega Annotation (EMA) can be used to synchronize spatial positions across platforms (with different coordinate system definitions).

The local coordinate system of annotations in the Unity environment: The positive X-direction points backward, the positive Y-direction points upward, and the positive Z-direction points to the right.

The local coordinate system of annotations in the xr-frame environment: The positive X-direction points backward, the positive Y-direction points upward, and the positive Z-direction points to the left.
The above directional differences arise from the different coordinate system definitions (left-handed/right-handed) used by Unity and xr-frame.
Using EMA to synchronize spatial positions offers the following significant advantages:
- Simplifies the development process: Automatically handles cross-platform coordinate conversions, avoiding the cumbersome logic and error-proneness of manual calculations.
- Improves debugging efficiency: Can be directly loaded on MegaToolbox, facilitating quick real-device testing and data validation.
Steps
Create annotation tool
Right-click in Unity's Hierarchy panel and select: EasyAR Mega > Tool > Annotation Tool (Edit Mode).

After creation, two nodes are generated in the scene: EasyAR.Mega.Annotation and MegaBlocks.
Select the EasyAR.Mega.Annotation node, and its Inspector panel will display input fields for username/email and password.

Log in to account
Enter your EasyAR account and password, then click login. Upon success, the Studio tool will appear in the Inspector panel.
Select Mega cloud localization library
Click the icon to the right of Mega Cloud Service.

Select the library to use.

After successfully loading the localization library and Mega Blocks information, the Studio tool panel appears as shown below.

Load block dense model
Click Load to the right of the Block name to dynamically load the dense model for that Block.

The model appears in the Scene tab after loading. Note: When the indicator shown below appears in the lower-left corner, the model within the current view is not fully loaded. Wait until this indicator disappears to confirm loading is complete.

Create annotation
Hold down Ctrl (Windows) / Command (Mac) in the scene, then left-click where you want to annotate.
Use model
Drag the imported model into the scene node as a child node of the annotation.
Set the model's Position and Rotation values to 0 in the Inspector panel. Adjust Scale as needed.
Note
EMA handles all coordinate conversion logic. Setting the model's Position and Rotation to 0 ensures the model's geometric center aligns perfectly with the annotation point. All position and rotation adjustments should be made by manipulating its parent node (the annotation node).

[Optional] Precise model position adjustment
For precise adjustment of model position and orientation, refer to How to use Unity editor to precisely align 3D content with real world.
Create new annotation data package
Click the icon to the right of the annotation data package in the Inspector panel.

Enter a name for the annotation data in the field and click the checkmark on the right.

After successful creation, it should appear as shown below. Click Confirm.

Click the upload icon to upload.

A success prompt appears after uploading.

Record annotation ID
You need to record the annotation data's name or ID to load the corresponding annotation data on xr-frame.

After successful upload, you can also see the corresponding information in your cloud localization library.

The uploaded annotation data name and ID can also be viewed here.

Next steps
- Create 3D Content Aligned with the Real World Using the Unity Editor
- Try Simulating Runtime in the Unity Editor
- Run the Sample Project in Full