EasyAR Sense Initialization

There are two methods to initialize EasyAR Sense in EasyAR Sense Unity Plugin, please choose the proper method according to your app details, in order to follow requirements from Compliance Guide or other requirements.

Automatic Initialization (Default)

Choose EasyAR > Sense > Configuration from Unity menu and check Initialize On Startup in Project Settings page.

../_images/image_g10_1.png

EasyAR Sense initialization will be called at the time point of Unity BeforeSceneLoad . If this time point does not match your requirements, you can use the initialization method in the next section.

To initialize using this method, license must be filled in Project Settings.

../_images/image_g10_3.png

If you want to setup license in other ways, please use the following method.

Manual Initialization

Choose EasyAR > Sense > Configuration from Unity menu and uncheck Initialize On Startup in Project Settings page.

../_images/image_g10_2.png

EasyAR Sense initialization will not be called automatically. You need to call EasyARController.Initialize to do initialization.

To initialize using this method, license can be filled in Project Settings, and initialize using EasyARController.Initialize without input parameters. It will use the license filled in Project Settings.

../_images/image_g10_4.png

You can also initialize using EasyARController.Initialize without input parameters. Parameter licenseKey will be used in the initialization when using this method instead of the license filled in Project Settings.

To be noticed, the method EasyARController.Initialize must be called before all other EasyAR interfaces (before all Awake callings of all EasyAR scripts). Usually, it must be called before adding any EasyAR components in runtime (created using scripts, active a inactive component in the scene, etc.).

If you want to call EasyARController.Initialize many times (this is not necessary generally), you must make sure to deinitialize using EasyARController.Deinitialize first before calling EasyARController.Deinitialize the second time. In addition, EasyARController.Deinitialize will be called automatically before app exits.