How to Use Samples

Preparation

Prepare Unity Environment

Read Platform Requirements to learn system and Unity versions EasyAR Sense Unity Plugin support and get Unity packages from the Unity website.

If it is your first time, suggest using LTS Releases from Unity.

Prepare Package

Get latest EasyAR Sense Unity Plugin package from download page. Samples are included in the package.

Get Licensing

Before using EasyAR Sense, you need to register on www.easyar.com and get a license key .


Editor Project Configuration

Create Empty Unity Project

Choose 3D, Core template When create a project. If you are using URP, you may reference Universal Render Pipeline (URP) Configuration for Configuration.

../_images/image_s1_1.png

Add Plugin Package

The plugin use Unity’s package to organize itself. It is distributed as a tarball file. The release package is a zip file, and you will get readme files and a tgz file after extracting the zip file. Do not extract the tgz file.

../_images/image_s0_3.png

It is suggested to put above tgz file inside the project, like in the Packages folder. Use Unity’s Package Manager window to install the plugin from a local tarball file.

../_images/image_s0_1.png

Choose the com.easyar.sense-*.tgz file in the popup dialogue.

NOTE: The tgz file cannot be deleted or moved to another place after import, so it is always a good practice to find a suitable place for the file before import. If you want to share the project with others, you can put the file inside the project and your version control system.

Import Sample(s) into Project

The samples are distributed within the plugin package. You can import samples into your project using Unity’s Package Manager window.

You can import all samples running on mobile phones together using the first **All Handheld AR**, or samples from the same category like **WorldSenseing All**,

../_images/image_s1_5.png

Or you can import individual sample without ** in the sample name.

../_images/image_s1_6.png

NOTE: samples start with ** cannot be imported when individual samples exist in the project, there would be duplicate assets otherwise.

Samples for Eyewear support can only be imported one by one and will not be included in **All Handheld AR**, because they are not included in the sample launcher.

Fill in License Key

Choose EasyAR > Sense > Configuration from Unity menu and fill in the License Key in the Project Settings. This page can be also opened from Edit > Project Settings > EasyAR.

../_images/image_s1_2.png ../_images/image_s1_3.png

Service Configurations

Some samples use EasyAR services. Service configurations are required for

This step can be skipped if not using above samples.

Add scenes

Open Build Settings,

../_images/image_s1_4.png

Add sample scenes of the Unity project into Build Settings. Move the launcher scene (AllSamplesLauncher) to the top if there is a one in the project.

../_images/image_s1_7.png ../_images/image_s1_8.png

Run in the Editor

If you have AllSamplesLauncher scene, you can open it (double click scene file or use File > Open Scene) and it can launch all samples. Or you can choose to open (double click scene file or use File > Open Scene) a single sample scene to run.

../_images/image_s1_9.png

If a camera is connected to the computer, it can run EasyAR Sense Unity Plugin samples from Unity Editor after the above configurations.

../_images/image_s1_12.gif

Note that not all features can work in the editor. Some of them can only run on Android or iOS devices. There will be popup messages and error logs for those unsupported samples when running in the editor.

../_images/image_s1_13.png

Run on Android or iOS Devices

Configure the project according to Android Project Configuration or iOS Project Configuration, switch to target platform and then click on the Build or Build And Run button in Build Settings or use other alternatives will compile the project and install the binaries on the phone. Permissions should be granted on the phone when running.

../_images/image_s1_10.png ../_images/image_s1_11.png