Configure for Android
To use the advanced features of Hercules, the prefab feature should be enabled in the Android Gradle module.
Setting up your Android Studio project
- Add the following to your gradle.properties file.
1 |
android.enablePrefab=true |
- Add the following to the android block in the build.gradle file.
1 2 3 4 5 6 |
android { ... buildFeatures { prefab true } } |
Setting up CMake / ndk-build (when using C/C++)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
// CMake find_packageHercules REQUIRED CONFIG) target_link_libraries( ... Hercules::Hercules ) // Android.mk LOCAL_SHARED_LIBRARIES := Hercules ifneq ($call ndk-major-at-least,21),true) $call import-add-path,$(NDK_GRADLE_INJECTED_IMPORT_PATH)) endif $call import-module, prefab/Hercules) |
- Add the Hercules.h file to your project and use the direct link to the .so file path.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
// CMake target_link_libraries( ... ${CMAKE_CURRENT_SOURCE_DIR}/../build/intermediates/merged_native_libs/${CMAKE_BUILD_TYPE}/out/lib/${ANDROID_ABI}/libHercules.so ) // Android.mk # for Hercules include $(CLEAR_VARS) LOCAL_MODULE := Hercules LOCAL_SRC_FILES := ../build/intermediates/merged_native_libs/debug/out/lib/$(TARGET_ARCH_ABI)/libHercules.so include $(PREBUILT_SHARED_LIBRARY) LOCAL_SHARED_LIBRARIES := Hercules |
Configure for iOS
How to Configure
- “${PROJECT_ROOT_DIR}/Pods/Hercules/Hive_SDK_iOS_External_${HIVE_SDK_VERSION}/Hercules.xcframework/${SIMULATOR_OR_PHONEOS}/Hercules.framework/Headers/Hercules.h”
Configure for Unity
Mobile
Windows
- Enter USE_HERCULES in Scripting Define Symbols
- Check Allow ‘unsafe’ Code.
- Use Hercules additional APIs via HerculesPlugin.
1ex) HerculesPlugin.GetVersion();
Configure for Unreal
Mobile
The Hercules module included in the Hive SDK Unreal Plugin does not support Hercules advanced features. To use the Hercules advanced features in the Unreal environment, see below.
-
Remove the Hercules module included in Hive SDK Unreal Plugin
-
Disable the removed Hercules module
1hive::Configuration::setUseHercules(false); -
Find the header and libraries in the Hercules folder located at the top of the plugin directory, and add them to your game project
Windows
If Target.Platform == UnrealTargetPlatform.Win64
is set in HIVESDK.Build.cs, .lib settings are required as shown below.
1 |
PublicAdditionalLibraries.Add(ModuleDirectory + "/ThirdParty/windows/lib/Hercules.lib"); |
After completing the setting, use the advanced features as shown in the example below.
1 2 3 4 5 6 |
yes) #include <Hercules.h> unsigned int hVersion = HerculesGetVersion(); const char* hUniqueId = HerculesGetUniqueInstanceId(); |