Cocos2d-x
本指南解释了如何在 Cocos2d-x 环境中安装 Hive SDK。
安卓
- 從 Hive 開發者網站下載套件,路徑為 下載 > Cocos2d-x。
- 將在 /PluginSource/Android 路徑中找到的 C++ 原始碼檔案鏈接到您的專案中。您可以鏈接位於 /proj.android/app/jni/hivesdk/lib/c++ 路徑中的已編譯庫,而不是鏈接 .cpp 原始碼檔案。
- 將以下 Android 庫添加到您 Gradle 專案的模組級 build.gradle 檔案中。
dependencies {
implementation(platform("com.com2us.android.hive:hive-sdk-bom:${project.HIVE_SDK_VERSION}"))
implementation "com.com2us.android.hive:hive-sdk"
implementation "com.com2us.android.hive:hive-plugin-java"
}
iOS
要為 iOS 安裝 Cocos2d-x,首先請遵循 Hive SDK iOS 指南 來設置您的項目 Podfile。然後,在 Podfile 設置中,添加 HiveSDKPlugin,如下所示。
...
target 'HIVE_SDK_Sample_App' do
# Add the frameworks to use here. At least one framework is required.
# Hive SDK C++ language interface plugin framework, required when using Hive SDK Cocos2d-x iOS
pod 'HiveSDKPlugin', $HIVE_SDK_VERSION
end
...