Table of Contents

View 3D real scene mesh

This article details how to preview spatial models using Unity and the Mega plugin, including the complete process of Unity installation, plugin import, Block viewer tool addition, and loading mapping results.

Environment preparation

Before previewing spatial models, you need to install Unity and import the Mega plugin.

Install Unity

Install Unity 2021.3 or later long-term support (LTS) version. Download addresses:

  • Mainland China region: Download the installation package from Unity Chinese page and follow the official instructions for installation.
  • Other regions: Download the installation package from Unity official website and follow the official instructions for installation.

First download Unity Hub, then you can select the Unity version on the webpage and download it from Hub, or select and install it in Unity Hub.

Install Unity on webpage

Login/register Unity account

Open Unity Hub, log in to your Unity account (register if you don't have one).

Register and login Unity account

Activate Unity license

Activate the corresponding license type according to actual needs. Note: Due to differences in Unity Hub versions or language settings, the interface may vary slightly, but the core activation process remains consistent.

Add Unity License

Select License

Create a new Unity project

Create project

In some versions, such as Unity 6, you need to download the corresponding template before creating a project.

Download template

Download Mega Unity plugin

Log in to your EasyAR account and go to the download page.

Download page navigation

Download the file indicated by the arrow in the image.

Download Mega plugin

After decompressing the downloaded .zip file, you will get the following directory structure:

Decompressed files

Important

Note: Do not decompress .tgz files. These are Unity packages that need to be imported directly through Unity Package Manager.

.
└── EasyARSenseUnityPluginForMega_**.zip          # Complete installation package
    ├── com.easyar.mega-**.tgz                    # Contains annotation tool and Block viewer tool
    ├── com.easyar.sense-**.tgz                   # Contains EasyAR Sense core library and Unity plugin
    ├── readme.cn.txt                             # Chinese readme file
    └── readme.en.txt                             # English readme file

Version number description: ** in the file name represents the version number, formatted as: Major.Minor.Patch + BuildNum.BuildHash. Please refer to the latest official release.

Import packages (UPM packages) into the project

Click Window -> Package Management -> Package Manager, then click the + sign in the top left corner of the pop-up window and select Install package from tarball....

Install package

Import in order:

com.easyar.sense-**.tgz
com.easyar.mega-**.tgz
Note

Before importing, it is recommended to copy the .tgz files to your Unity project folder (e.g., store them in the Packages directory). Do not move or delete these .tgz source files after importing, otherwise Unity will not be able to load the corresponding packages.

Verify successful plugin import

Right-click in the Hierarchy panel. If you can see the component creation options for EasyAR Sense and EasyAR Mega, it means the plugins were imported successfully.

Verify successful import

Add Block viewer tool

Right-click in a blank area of the Hierarchy panel and select EasyAR Mega > Tool > Block Viewer (Edit Mode).

Add Block viewer tool

A new node will appear after adding.

Added Block viewer tool

Load mapping result Block

Log in to EasyAR account

Click the added node and enter your EasyAR account username and password in the toolbar.

Login in Unity

Select corresponding cloud service and repository

Click the button in the top right corner of the cloud service component. In the pop-up dialog, select Mega Block -> Mega Block Storage Service, then choose the repository containing the mapping results below, and finally click the "OK" button.

Mega cloud service component

Mega cloud service pop-up

Load Block

Select the mapping result Block in the Mega Blocks component and click the "Load" button to preview the spatial model in the scene.
If unfamiliar with Unity operations, refer to Unity beginner tutorial.

Load Block

Preview of Block effect is as follows:

Preview Block