Plugin Introduction

EasyAR Sense Unity Plugin exposes EasyAR Sense features into Unity as a plugin. It provides rich features of EasyAR Sense and easy to use interfaces designed delicately for Unity users. It can work with or without AR Foundation and supports use on AR/VR/MR headsets such as Apple Vision Pro.

EasyAR Sense Unity Plugin is a very thin wrapper build above EasyAR Sense C# API to expose EasyAR Sense features into Unity. It is always a good practice to read EasyAR Sense Documentation to understand how EasyAR Sense works.

Download

Please vist download page of EasyAR website https://www.easyar.com/view/download.html , there are three different files for the Unity Plugin,

../_images/image_s0_2.png

The files and contents after unzip are as follows, download the files as needed.

.
├── EasyARSenseUnityPlugin_**.7z                // EasyAR Sense Unity Plugin, download when EasyAR Mega is not to be used
│   ├── com.easyar.sense-**.tgz                      EasyAR Sense Unity Plugin (AVP and XREAL device support included)
│   ├── readme.cn.txt
│   └── readme.en.txt
├── EasyARSenseUnityPluginForMega_**.7z         // EasyAR Sense Unity Plugin (for Mega), download when EasyAR Mega is to be used
│   ├── com.easyar.mega-**.tgz                       EasyAR Mega Support (Mega Studio)
│   ├── com.easyar.sense-**.tgz                      EasyAR Sense Unity Plugin (AVP and XREAL device support included)
│   ├── readme.cn.txt
│   └── readme.en.txt
└── EasyARSenseUnityPluginExtensions_**.7z      // EasyAR Unity XR Extensions, download this supplementary if Pico or Rokid is to be used
    ├── com.easyar.sense.ext.hmdtemplate-**.tgz      Sample template to support head mounted display, cannot run directly
    ├── com.easyar.sense.ext.pico-**.tgz             Pico Extension
    ├── com.easyar.sense.ext.rokid-**.tgz            Rokid Extension
    ├── readme.cn.txt
    └── readme.en.txt

How to Use

EasyAR Sense Unity Plugin now require Unity 2021.3 or later.

The plugin use Unity’s package to organize itself. It is distributed as a tarball 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.

Versioning

EasyAR Sense Unity Plugin follow Unity’s required package versioning (using Semantic Versioning) starting from version 4000. Version number of the plugin is not the same with EasyAR Sense and release frequency may differ, too.

Inside the Plugin

EasyAR Sense

Release packages of the plugin has EasyAR Sense libraries inside, so a separate EasyAR Sense package is not required when using the plugin.

The EasyAR Sense libraries cannot be replaced to other versions normally. In case when you are trying to make the plugin work on a different EasyAR Sense version, you must make sure the csapi comes together with the libraries.

Scripts

The plugin is designed to be a thin Unity wrapper of EasyAR Sense, so most scripts are controllers of EasyAR Sense components in the 3D scene providing a few extensions in the Unity environment. It helps to organize and connect EasyAR Sense components.

The plugin use as much Unity features as possible, like start/stop in OnEnable/OnDisable, most EasyAR Sense features can work without writing scripts. The plugin wraps all functions from EasyAR Sense.

The plugin is open sourced. You can use the plugin directly to create AR experience within short time. You can also reference the source code to create more custom usages of EasyAR Sense or even a Unity Plugin of your own. EasyAR does not provide technical support for custom plugin creation in normal.

Editors

The plugin provides some editor features to help development, including but limited to

  • Menu items to create AR Session and other AR components

  • Edit time diagnostics tool:Session Validaion Tool

  • Playback eif file and simulate running on device

  • Script input parameters before start on the Inspector

  • Runtime control like CenterMode and HorizontalFlipMode

  • Menu entry for license key and cloud service configurations

  • Gizmos for image targets

  • Tools for image target data generation

Samples

The plugin release comes with a few samples to demonstrate features and combination of different algorithms from EasyAR Sense.

The samples are distributed within the plugin package. You can import samples into your project using Unity’s Package Manager window. See How to Use Samples for more details.

Samples has a launcher; you can start most samples from the launcher. To use the launcher, you must add the launcher scene and all other scenes referenced by the launcher into the build settings.

Samples are designed to be straight forward of showing how API can be used and how EasyAR Sense work. Feel free to build your application on top of the sample or copy sample code for your projects, but remember the sample is NOT the plugin itself, and all codes in the sample are not guaranteed to be reusable in any condition without change.

EasyAR Sense and the plugin has rich APIs. Although important features and usages are demonstrated, the samples still would not cover all API callings and feature usages. If you find the sample do not satisfy the needs of your project, try read API Reference to learn all interfaces and the corresponding features of EasyAR Sense first.

Start with samples, they will help you understand how EasyAR Sense and the Unity Plugin work.