How to use advanced features
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¶
-
For Android Gradle Plugin < 4.1
- Add the following to your gradle.properties file.
-
For Android Gradle plugin ≥ 4.1
- Add the following to the android block in the build.gradle file.
Setting up CMake / ndk-build (when using C/C++)¶
- For NDK ≥ r21
// When using CMake
find_package(hercules REQUIRED CONFIG)
target_link_libraries(
...
hercules::Hercules
)
// When using 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)
- NDK < r21
Add the Hercules.h file to your project and use the direct link to the .so file path.
// CMake
target_link_libraries(
...
${CMAKE_CURRENT_SOURCE_DIR}/../build/intermediates/merged_native_libs/${CMAKE_BUILD_TYPE}/out/lib/${ANDROID_ABI}/libHercules.so
)
// Android.mk
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¶
Find .h under the path of the Hercules framework installed in the project through CocoaPods, and import it into the project.
You can select and use any of the headers included in the simulator or device target path.
The path is: ${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¶
Project settings¶
-
Add USE_HERCULES to the Unity preprocessor flag.
- Player Settings → Other Settings → Script Compilation → Scripting Define Symbols
-
Enable Allow 'unsafe' Code.
- Player Settings → Other Settings → Script Compilation → Allow 'unsafe' Code
Configure for Unreal¶
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.
- Find the header and libraries in the Hercules folder located at the top of the plugin directory, and add them to your game project
- If
Target.Platform == UnrealTargetPlatform.Win64
is set in HIVESDK.Build.cs, .lib settings are required as shown below.