Strasza wrote:
Hello Amefuri,
You can bundle the .dat and .xml file that are associated with your Device Database and load them at run time. This article provides some examples of how to load a database from the SD card: https://library.vuforia.com/articles/Solution/Working-with-Vuforia-and-Unity.html#load-dataset
This old post by dm3d has an example script of loading and activating a Device Database at runtime and then assigning it an augmentation: https://developer.vuforia.com/forum/faq/unity-load-dataset-setup-trackables-runtime
Let me know if you have further questions on this topic.
Thanks,
-Vuforia Support
Thank you I have managed to solve most of my problems but there is one issue please help me:
Dynamic data set loader script: Loops TrackableBehaviour and adds them DefaultTrackableEventHandler script.
tb.gameObject.AddComponent<DefaultTrackableEventHandler>();
When i try to access that script with GetComponent, for OnTargetFound event, it gives null exception:
tb.gameObject.GetComponent<DefaultTrackableEventHandler>().OnTargetFound.AddListener(CarFound); is giving null exception
tb.gameObject.GetComponent<DefaultTrackableEventHandler>().OnTargetFound.RemoveAllListeners(); is giving null exception
I can reach DefaultTrackableEventHandler component but cant do anything with it.
DefaultTrackableEventHandler dteh = tb.gameObject.GetComponent<DefaultTrackableEventHandler>(); is NOT giving null exception
b.gameObject.GetComponent<DefaultTrackableEventHandler>().enabled = false; is working as well
void CarFound()
{
augmentation.SetActive(true);
}
Please help me
I am using latest vuforia 9.4.6 with. 2019.3.5 editor but that solution didnt work because DefaultTrackableEventHandler script resets itself when editor opens.
So what i did is:
tb.gameObject.GetComponent<DefaultTrackableEventHandler>().OnTargetLost = new UnityEngine.Events.UnityEvent();
tb.gameObject.GetComponent<DefaultTrackableEventHandler>().OnTargetFound = new UnityEngine.Events.UnityEvent();
in my script.