How to Use Samples¶
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.
Get latest EasyAR Sense Unity Plugin package from download page. Samples are included in the package.
Editor Project Configuration¶
Create Empty Unity Project¶
Choose 3D template When create a project. If you are using URP, you may reference Universal Render Pipeline (URP) Configuration for Configuration.
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
com.easyar.sense-*.tgz file in the popup dialogue.
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
Or you can import individual sample without
** in the sample name.
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. Nreal samples uses Nreal SDK prefab to keep compatibility, but Unity 2021.2 build and run will fail if prefab does not exist, so do not import them into your project if there is no Nreal SDK in your project.
Fill in License Key¶
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.
Some samples use EasyAR services. Service configurations are required for
This step can be skipped if not using above samples.
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.
Run in the Editor¶
If you have AllSamplesLauncher scene, you can open it and it can launch all samples. Or you can choose to open a single sample scene to run.
If a camera is connected to the computer, it can run EasyAR Sense Unity Plugin samples from Unity Editor after the above configurations.
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.
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 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.