Automatic Database Loading in Unity

Beginning Vuforia Engine 7.1, developers no longer need to manually load and activate databases in the Vuforia Configuration Panel. Instead, when a Target is loaded on a scene, the database associated with that Target will be automatically loaded and activated.

Vuforia Configuration Panel                                                                   

Notice that the “Databases” section no longer contains check boxes in Vuforia Engine 7.1.

Vuforia Engine 7.0

Vuforia Image

Vuforia Engine 7.1

Vuforia Image

Manual Loading

Prior to Vuforia Engine 7.1, some developers may have written code to better control when Databases are loaded and available for Vuforia Engine. In this scenario, developers would leave the databases unloaded in the Vuforia Configuration Panel and would explicitly load databases via code (Dataset.Load) at the appropriate time. Developers that employ this type of manual loading need to be aware that Targets will automatically load their respective databases in Vuforia Engine 7.1 regardless of what the previous state of the Databases was in the Vuforia Configuration Panel prior to Vuforia Engine 7.1.

In order to manually load Databases in Vuforia Engine 7.1, developers must make sure that their individual Vuforia Target behaviours or the attached GameObjects are disabled within the Unity editor. If a Vuforia Behaviour is active during the loading of a Scene, then its database will be loaded.

Recommended Migration

If you have written code to only load the appropriate database for the targets that are used in a particular scene, the new functionality can be used in place of this type of manual loading.  

If your project loads Databases via code and you don’t want to make use of automatic database loading, go through your entire project and for every Target Behaviour in your project, disable the Target Behaviour component. For instance, if your project uses Image Targets, find all the instances of the Image Target Behaviour component and disable them.

Next, find the appropriate line of code which loads databases and, just before that code, enable the behavior by using (or some derivation):

ImageTargetBehaviour imageTarget = GetComponent<ImageTargetBehaviour>();
imageTarget.enabled = true;
//Load and Activate the Database here