C API Unity API
Unity API Reference (Version 10.22.5)
VuforiaApplication Class Reference

The VuforiaApplication class provides a way to initialize and deinitialize Vuforia as well register to lifecycle events More...

Public Member Functions

void Deinit ()
 Deinitialize Vuforia Engine More...
 
VuforiaBehaviour GetVuforiaBehaviour ()
 The VuforiaBehaviour is used to control Vuforia at runtime, per scene Returns null if there is no VuforiaBehaviour in the scene More...
 
void Initialize ()
 Initialize Vuforia. Used when "delayed initialization" has been selected in the VuforiaConfiguration, otherwise this happens automatically While running in the Unity Editor, it takes couple frames to initialize. More...
 
void Initialize (FusionProviderOption fusionProviderOption)
 Initialize Vuforia while specifying a configuration for the Fusion Provider. Used when "delayed initialization" has been selected in the VuforiaConfiguration. More...
 
void Initialize (string driverName, IntPtr userData)
 Initialize Vuforia while setting up the name of the library that is loaded dynamically and used as an external source of camera or other input data. The library must support the Vuforia Driver API and it must be placed inside the app package to be loaded properly. The exact path depends on the platform: More...
 
void SetHint (int hint, bool value)
 Advanced option to set an internal hint code before initialization More...
 

Static Public Member Functions

static string GetVuforiaLibraryVersion ()
 Returns the version of the Vuforia SDK More...
 

Public Attributes

bool IsInitialized => CoreDependencies.Instance.Engine.IsInitialized
 Returns true if the Vuforia Engine was successfully initialized More...
 
bool IsRunning => CoreDependencies.Instance.Engine.IsRunning
 Returns true if the Vuforia Engine has been started and is currently running More...
 

Properties

static VuforiaApplication Instance [get]
 
Action OnBeforeVuforiaInitialized
 Use this callback for configuring tasks before initializing Vuforia Engine. The callback is triggered before Vuforia Engine is initialized, provided that Delayed Initialization is enabled, or before performing an initialization after a deinitialization of Vuforia Engine. More...
 
Action< VuforiaInitErrorOnVuforiaInitialized
 Triggered when Vuforia Engine has initialized More...
 
Action OnVuforiaStarted
 Triggered after Vuforia has started delivering frame updates More...
 

Events

Action OnVuforiaDeinitialized
 Triggered when Vuforia has been deinitialized More...
 
Action< VuforiaEngineErrorOnVuforiaError
 Triggered when a lifecycle-related engine error occurs after initialization More...
 
Action< bool > OnVuforiaPaused
 Triggered when Vuforia is paused True when Vuforia was paused More...
 
Action OnVuforiaStopped
 Triggered when Vuforia has been stopped More...
 

Detailed Description

The VuforiaApplication class provides a way to initialize and deinitialize Vuforia as well register to lifecycle events

Member Function Documentation

◆ Deinit()

void Deinit ( )
inline

Deinitialize Vuforia Engine

◆ GetVuforiaBehaviour()

VuforiaBehaviour GetVuforiaBehaviour ( )
inline

The VuforiaBehaviour is used to control Vuforia at runtime, per scene Returns null if there is no VuforiaBehaviour in the scene

Returns

◆ GetVuforiaLibraryVersion()

static string GetVuforiaLibraryVersion ( )
inlinestatic

Returns the version of the Vuforia SDK

◆ Initialize() [1/3]

void Initialize ( )
inline

Initialize Vuforia. Used when "delayed initialization" has been selected in the VuforiaConfiguration, otherwise this happens automatically While running in the Unity Editor, it takes couple frames to initialize.

◆ Initialize() [2/3]

void Initialize ( FusionProviderOption  fusionProviderOption)
inline

Initialize Vuforia while specifying a configuration for the Fusion Provider. Used when "delayed initialization" has been selected in the VuforiaConfiguration.

Parameters
fusionProviderOptionThe Fusion Provider configuration.

◆ Initialize() [3/3]

void Initialize ( string  driverName,
IntPtr  userData 
)
inline

Initialize Vuforia while setting up the name of the library that is loaded dynamically and used as an external source of camera or other input data. The library must support the Vuforia Driver API and it must be placed inside the app package to be loaded properly. The exact path depends on the platform:

  • Android: [apk-root-dir]/lib/[architecture]/library.so
  • UWP: [appx-root-dir]/library.dll
  • iOS: [appx-root-dir]/Frameworks/library.framework

Vuforia will try to initialize and use the functionality provided by the Driver.

To disable the Vuforia Driver functionality the following must be done:

  • Call VuforiaApplication.Instance.Deinit()
  • Call VuforiaApplication.Instance.Initialize()

This functionality is currently only supported on Editor, Android, iOS and UWP platforms.

Parameters
driverNameFull file name of the Driver library. Setting this to null or empty string, will disable the use of the Driver functionality.
userDataOptional user defined data to be passed into the library when it gets loaded. Vuforia only forwards the data and doesn't process it in any way. This value can be accessed at any time throughout the Vuforia lifecycle, so it MUST be valid until Vuforia is de-initialized. Set to IntPtr.Zero if not needed.

◆ SetHint()

void SetHint ( int  hint,
bool  value 
)
inline

Advanced option to set an internal hint code before initialization

Parameters
hint
value

Member Data Documentation

◆ IsInitialized

bool IsInitialized => CoreDependencies.Instance.Engine.IsInitialized

Returns true if the Vuforia Engine was successfully initialized

◆ IsRunning

bool IsRunning => CoreDependencies.Instance.Engine.IsRunning

Returns true if the Vuforia Engine has been started and is currently running

Property Documentation

◆ Instance

VuforiaApplication Instance
staticget

◆ OnBeforeVuforiaInitialized

Action OnBeforeVuforiaInitialized
addremove

Use this callback for configuring tasks before initializing Vuforia Engine. The callback is triggered before Vuforia Engine is initialized, provided that Delayed Initialization is enabled, or before performing an initialization after a deinitialization of Vuforia Engine.

◆ OnVuforiaInitialized

Action<VuforiaInitError> OnVuforiaInitialized
addremove

Triggered when Vuforia Engine has initialized

◆ OnVuforiaStarted

Action OnVuforiaStarted
addremove

Triggered after Vuforia has started delivering frame updates

Event Documentation

◆ OnVuforiaDeinitialized

Action OnVuforiaDeinitialized

Triggered when Vuforia has been deinitialized

◆ OnVuforiaError

Action<VuforiaEngineError> OnVuforiaError

Triggered when a lifecycle-related engine error occurs after initialization

◆ OnVuforiaPaused

Action<bool> OnVuforiaPaused

Triggered when Vuforia is paused True when Vuforia was paused

◆ OnVuforiaStopped

Action OnVuforiaStopped

Triggered when Vuforia has been stopped