Engine Class¶
schemaHash¶
获得版本散列值,用于确保各个语言的类型定义与运行库的类型定义版本一致。
- C: int easyar_Engine_schemaHash(void)¶
- C++17: static int schemaHash()¶
- Traditional C++: static int schemaHash()¶
- Java: public static int schemaHash()¶
- Kotlin: companion object fun schemaHash(): Int¶
- Objective-C: + (int)schemaHash¶
- Swift: public static func schemaHash() -> Int32¶
- C#: public static int schemaHash()¶
onPause¶
处理应用onPause,暂停内部任务。
- C: void easyar_Engine_onPause(void)¶
- C++17: static void onPause()¶
- Traditional C++: static void onPause()¶
- Java: public static void onPause()¶
- Kotlin: companion object fun onPause(): Unit¶
- Objective-C: + (void)onPause¶
- Swift: public static func onPause() -> Void¶
- C#: public static void onPause()¶
onResume¶
处理应用onResume,重启内部任务。
- C: void easyar_Engine_onResume(void)¶
- C++17: static void onResume()¶
- Traditional C++: static void onResume()¶
- Java: public static void onResume()¶
- Kotlin: companion object fun onResume(): Unit¶
- Objective-C: + (void)onResume¶
- Swift: public static func onResume() -> Void¶
- C#: public static void onResume()¶
errorMessage¶
用于初始化失败时获得错误信息。
- C: void easyar_Engine_errorMessage(easyar_String * * Return)¶
- C++17: static std::string errorMessage()¶
- Traditional C++: static void errorMessage(String * * Return)¶
- Java: public static java.lang.@Nonnull String errorMessage()¶
- Kotlin: companion object fun errorMessage(): String¶
- Objective-C: + (NSString *)errorMessage¶
- Swift: public static func errorMessage() -> String¶
- C#: public static string errorMessage()¶
versionString¶
获得EasyARSense的版本号。
- C: void easyar_Engine_versionString(easyar_String * * Return)¶
- C++17: static std::string versionString()¶
- Traditional C++: static void versionString(String * * Return)¶
- Java: public static java.lang.@Nonnull String versionString()¶
- Kotlin: companion object fun versionString(): String¶
- Objective-C: + (NSString *)versionString¶
- Swift: public static func versionString() -> String¶
- C#: public static string versionString()¶
name¶
获得EasyARSense的产品名称。(包括版本变种、操作系统和CPU架构)
- C: void easyar_Engine_name(easyar_String * * Return)¶
- C++17: static std::string name()¶
- Traditional C++: static void name(String * * Return)¶
- Java: public static java.lang.@Nonnull String name()¶
- Kotlin: companion object fun name(): String¶
- Objective-C: + (NSString *)name¶
- Swift: public static func name() -> String¶
- C#: public static string name()¶
initialize¶
初始化EasyAR。只能在初始化之后调用其它功能。
Android Only 需要传入一个承载内容的Activity,用于实现权限请求、录屏等功能。这个方法会自动加载 EasyAR native 库文件。如果你需要更加灵活的native库的加载控制,可以使用 Engine.initializeWithoutSoLibraryLoad 。注意:在Android上运行Unity时,调用initialize方法也必须调用Java方法,而不能直接调用C#的对应方法。
- C: bool easyar_Engine_initialize(easyar_String * key)¶
- C++17: static bool initialize(std::string key)¶
- Traditional C++: static bool initialize(String * key)¶
- Java: public static boolean initialize(android.app.@Nonnull Activity activity, java.lang.@Nonnull String key)¶
- Java: public static boolean initialize(android.app.@Nonnull Activity activity, java.lang.@Nonnull String key, java.lang.@Nonnull String soLibraryDir)¶
- Kotlin: companion object fun initialize(activity: android.app.Activity, key: String): Boolean¶
- Kotlin: companion object fun initialize(activity: android.app.Activity, key: String, soLibraryDir: String): Boolean¶
- Objective-C: + (bool)initialize:(NSString *)key¶
- Swift: public static func initialize(_ key: String) -> Bool¶
- C#: public static bool initialize(string key)¶
initializeWithoutSoLibraryLoad¶
初始化EasyAR。只能在初始化之后调用其它功能。
这个方法不会加载 EasyAR native 库文件。需要保证自己加载这些库或者使用 Engine.loadLibraries 加载。
- Java: public static boolean initializeWithoutSoLibraryLoad(android.app.@Nonnull Activity activity, java.lang.@Nonnull String key)¶
- Kotlin: companion object fun initializeWithoutSoLibraryLoad(activity: android.app.Activity, key: String): Boolean¶
loadLibraries¶
加载 native 库文件,只需要在使用 Engine.initializeWithoutSoLibraryLoad 初始化 EasyAR的时候调用。
- Java: public static void loadLibraries()¶
- Java: public static void loadLibraries(java.lang.@Nonnull String soLibraryDir)¶
- Kotlin: companion object fun loadLibraries(): Unit¶
- Kotlin: companion object fun loadLibraries(soLibraryDir: String): Unit¶