I have a single scene in my mobile project with multiple pages, one of these is an AR page and I want to initialize Vuforia when entering the page. This is because otherwise the camera permission dialog appears at app launch where the user doesn't yet know what the camera will be used for. I would really prefer the camera permission dialog to appear when entering the AR page, and it seems the automatic Vuforia initialization at app launch is what triggers this.
I've read about delayed Vuforia initialization in Unity from various sources both on this forum and outside. It seems I need to have "Delayed Initialization" set in the Vuforia Configuration file, Vuforia related scripts disabled (VuforiaBehaviour, any image trackers and dynamic dataset loaders) and call VuforiaRuntime.Instance.InitVuforia() where I need it. After that I'm supposed to activate all the Vuforia related scripts and objects. The thing is, to my knowledge there is no way to know when VuforiaRuntime has finished initializing, and infact, it seems VuforiaRuntime.Instance.InitializationState seems to remain in the enum value "INITIALIZING" until I activate the Vuforia content in the scene. Only after that the initialization state seems to switch to "INITIALIZED". There doesn't seem to be any event callbacks for initialization either.
So my question is, after calling VuforiaRuntime.Instance.InitVuforia() how do I know when it's safe to activate VuforiaBehaviour and other AR related content in the scene?
Hello,
Hello,
In Unity, there are callbacks for determinin the status of Vuforia initialization: