跳轉至

Unity

hive_config.xml 檔案已創建,並且檔案內的項目已配置。在 Hive SDK Unity 中,有兩種方法可以創建和配置 hive_config.xml 檔案。

  1. 使用 Unity Hive Config Editor 自動生成和配置文件
  2. 手動創建和配置文件

Unity hive 配置編輯器設置

在Unity環境中,您可以自動創建hive_config.xml文件並使用Unity Hive 配置編輯器分配配置值。

設定作業系統和認證版本

選擇 Hive > Hive 設定 (編輯設定),並在 編輯器 畫面上設置必要的值。首先,檢查 作業系統Hive 應用程式 ID。然後,為了使用 Google 認證,選擇作業系統並在 Auth 菜單下的 Google SignIn 項目中設置值。

Google 登入設定

要使用常規的 Google 認證,請根據以下資訊在 Auth 菜單中為 Google SignIn 項目輸入所需的值。

  • 在 Google App Id 欄位中輸入您收到的 AppID。
  • 在 Google Server Client ID 欄位中輸入您收到的網頁應用程式的 Client ID 值。

Hive配置設定

您可以在hive_config.xml 文件中配置的值中设置以下值。

<

項目 作業系統 描述 必需 SDK 預設值
appId Android, iOS, Windows 遊戲建置識別碼。 X
  • Android: 包名
  • iOS: 包 ID
  • Windows: 應用程式 ID
zone Android, iOS, Windows Hive 客戶端將連接的伺服器。
  • real: 生產伺服器
  • sandbox: 測試伺服器
X `real`
useLog Android, iOS, Windows 是否啟用 Hive 客戶端的內部操作日誌。當啟用日誌時,日誌將輸出到開發工具螢幕。
  • true: 啟用日誌
  • false: 禁用日誌
X `false`
ageGateU13 Android, iOS, Windows COPPA ageGateU13 應用狀態。要將 COPPA ageGateU13 應用於 Hive SDK,您必須在 Hive 控制台中註冊 COPPA 條款,並在初始化 Hive SDK 之前將此值設置為 true。如果您不希望應用 COPPA ageGateU13,則必須在 Hive 控制台中註冊 COPPA 以外的條款,並在初始化 Hive SDK 之前將此值設置為 false
  • true: 將 COPPA ageGateU13 應用於 HiveSDK
  • false: 不將 COPPA ageGateU13 應用於 HiveSDK
X `false`
hiveOrientation Android, iOS, Windows Hive SDK 的 UI 將根據設備方向設置顯示。
  • all: 根據橫向和縱向方向顯示
  • portrait: 以縱向顯示
  • landscape: 以橫向顯示
  • undefined: 遵循遊戲應用設置
X 'undefined'
channel Android, iOS, Windows 遊戲應用中使用的登錄和應用內支援服務的平台。如果您通過 Hive SDK 登錄外部社交媒體或使用應用內購買,則對應於 C2S。用於從 Hive SDK 收集分析數據。
  • C2S: Hive 平台
  • KAK: Kakao
  • LIN: Line
  • STE: Steam
  • EPI: Epic Store
  • FAS: FastSprint
O `C2S`
market Android, iOS, Windows 這是處理應用內購買的市場。它用於 Hive SDK 分析收集。
  • GO: Google PlayStore
  • AP: Apple AppStore
  • ON: OneStore
  • AM: Amazon AppStore
  • LE: Com2us Lebi
  • HS: Hive Store
  • GA: Samsung GalaxyStore
  • HU: Huawei AppGallery
O 空白值
agreementDetermineBase Android, iOS 確定獲得同意條款的標準。您可以選擇 `device` 或 `account`,默認為 `device`。
  • 當選擇 device 時,條款同意彈出窗口將在 AuthV4.setup() 的初始化階段顯示,並且每個設備只需同意一次。根據設備獲得同意後,當用戶在同一設備上使用不同帳戶登錄時,不會再次要求同意。您可以使用 `resetAgreement()` 清除同意記錄。
  • 當選擇 account 時,條款同意彈出窗口將在登錄時顯示,並且每個 PlayerId 只需同意一次。這只能在未應用 COPPA ageGateU13 時使用。您無法使用 `resetAgreement()` 清除同意記錄。市場跟踪工具將從同意時開始運作。
X `device`
unsupportedUAShareType Android 這是一個 Android 特定設置,用於配置在使用 促銷用戶獲取 (UA) 分享 功能時不顯示圖標的分享應用。配置的目標將不會在 UI 中顯示其圖標。
  • SMS
  • URL
  • KAKAO
  • LINE
  • WHATSAPP
  • FACEBOOK
  • MESSENGER
  • WECHAT
X 空白值
httpConnectTimeout Android, iOS, Windows 這是 Hive 客戶端內部使用的 HTTP 連接超時持續時間(以秒為單位)。
  • 默認值設置為 8 秒,除非在特殊情況下,否則禁止更改此值。
X `8`(單位:秒)
httpReadTimeout Android, iOS, Windows 這是 Hive 客戶端內部使用的 HTTP 讀取超時持續時間(以秒為單位)。
  • 默認值設置為 8 秒,除非在特殊情況下,否則禁止更改此值。
X `8`(單位:秒)

hive_config.xml 文件创建

檢查員 完成設置後,請按照以下步驟創建hive_config.xml文件。

  • Android: 点击保存并重新生成设置文件按钮以生成AndroidManifest.xml文件和hive_config.xml文件。hive_config.xml文件将创建在以下目录中。
    • Unity 2021及以上版本: /Assets/HiveSDK/hive.androidlib/src/main/res/raw
    • Unity 2021以下版本: /Assets/Plugins/Android/res/raw/
  • iOS: 点击保存并重新生成设置文件按钮以生成Info.plist文件和hive_config.xml文件。hive_config.xml文件将创建在以下目录中。
    • /Assets/Plugins/iOS/<

hive_config.xml 範例

以下是使用身份驗證(Google 身份驗證)和支付(Google Play 商店或 Apple AppStore)時的 hive_config.xml 文件示例。請根據您希望使用的 Hive SDK 特性和應用環境修改、添加或刪除值。由於 iOS 只支持 Apple AppStore 支付,因此在 Unity iOS 環境中將市場設置為 AP

<properties>

    <!-- Hive SDK Common Settings: START -->
    <!-- Set unique game build identifier -->
    <appId>com.sample.your</appId>

    <!-- Select Hive platform server. sandbox for development, real for production
        (sandbox, real) -->
    <zone>real</zone>

    <!-- Set whether to use SDK internal operation logs
        (true, false) -->
    <useLog>false</useLog>

    <!-- Set whether to apply ageGateU13
        (true, false) -->
    <ageGateU13>false</ageGateU13>

    <!-- Hive Orientation setting -->
    <hiveOrientation>landscape</hiveOrientation>

    <!-- Channel setting (login and in-app support service platform)
        (C2S: Hive platform) -->
    <channel>C2S</channel>

    <!-- Payment market setting
        (GO: Google Play, LE: Com2us Lebi, AP: Apple App Store) -->
    <market>GO</market>

    <!-- Set criteria for receiving agreement to terms
        (device, account) -->
    <agreementDetermineBase>false</agreementDetermineBase>

    <!-- Set HTTP Connect Timeout used internally by Hive SDK in seconds
        (Do not change unless in special cases) -->
    <httpConnectTimeout>8</httpConnectTimeout>

    <!-- Set HTTP Read Timeout used internally by Hive SDK in seconds
        (Do not change unless in special cases) -->
    <httpReadTimeout>8</httpReadTimeout>
    <!-- Hive SDK Common Settings: END -->

    <!-- Hive SDK Feature Settings: START -->
    <!-- Authentication feature setting: Use Google authentication -->
    <providers>             
        <google playAppId="123456789012"  clientId="123456789012-abc.apps.googleusercontent.com"  serverClientId="123456789012-abc.apps.googleusercontent.com"  reversedClientId="com.googleusercontent.apps.123456789012-abc"  deviceFlowClientId="331526026701-gn1abq1ev23nqj7rdvvlaamf7ii4f3u9.apps.googleusercontent.com" />
    </providers>
    <!-- Hive SDK Feature Settings: END -->

</properties>
Info

Hive SDK 配置可以在應用程序構建之前將值存儲在配置文件中,或在運行時(應用程序執行期間)更改配置值。欲了解更多詳細信息,請查看 Hive SDK 配置