Install the Unity SDK
注釈:本資料はAI技術を用いて翻訳されています。
Overview
AccelByte Gaming Services (AGS) Game SDK for Unity を使用して、ゲームに AGS の機能を実装しましょう。
GitHub 上の AGS Unity SDKPrerequisites
- Unity バージョン 2020 以降
- Game Namespace を作成する
- IAM Client を作成する
- Client ID を取得する
AGS Public Cloud は現在、Unity バージョン 2019.2 および 2019.4 以降をサポートしています。
また、BaseUrl には必ず以下の形式を使用してください。使用しない場合、ドメインの不一致により API 呼び出しがエラーを返す可能性があります。
https://<Studio ID>-<Game TitleID>.prod.gamingservices.accelbyte.io
- 例:
https://mystudio-myawesomegame.prod.gamingservices.accelbyte.io
Tutorial
Unity が UPM Package を使用できるようにするには、コンピューターに Git をインストールして設定する必要があります。
インストールと設定
AGS Game SDK for Unity をダウンロードしてインストールし、AGS の設定ファイルをセットアップする方法を説明します。
Public Cloud tier では、Unity 用の設定ファイルをダウンロードして保存できます。
設定ファイルは、セットアップ時に Public Cloud tier のダッシュボードからダウンロードできます。その後は、AGS Admin Portal の OAuth Clients ページからもダウンロードできます。
AGS Private Cloud には、まだ設定ファイルのダウンロード機能がありません。
-
Unity プロジェクトを開きます。
-
Window > Package Manager > + > Add package from git URL に移動し、ポップアップに
https://github.com/AccelByte/accelbyte-unity-sdk.gitを貼り付けて、Add をクリックします。注記必ず最新バージョンをダウンロードしてください。
プロジェクトで Assembly Definitions を使用している場合は、com.accelbyte.UnitySDK アセンブリを参照として追加する必要があります。
-
SDK を設定します。
プロジェクトで SDK を設定する方法は 2 つあります。エディタツールを使用する方法と、設定ファイルを手動で作成・編集する方法です。
エディタツールを使用して SDK を設定する
クライアント設定を編集するには、メニューバーの AccelByte > Edit Client Settings に移動します。サーバー設定の場合は Edit Server Settings に移動します。エディタに表示される必須項目を入力し、Save をクリックします。

これを実行すると、クライアントエディタが
AccelByteSDKConfig.jsonとAccelByteSDKOAuthConfig.jsonを生成して自動的に値を入力します。サーバーエディタはAccelByteServerSDKConfig.jsonとAccelByteServerSDKOAuthConfig.jsonを生成します。すべての AccelByte SDK 設定ファイルはAssets/Resourcesフォルダに保存されます。設定ファイルを手動で作成する
Assets/Resourcesフォルダにこれらのファイルを作成し、適切な形式で値を入力します。「Required」の値は、AGS Admin Portal の設定に基づいて置き換えてください。- Client Configs
- Server Configs
AccelByteSDKConfig.json
{
"Default": {
"BaseUrl": "Required",
"Namespace": "Required",
"PublisherNamespace": "Required",
"RedirectUri": "Required",
"UsePlayerPrefs": false,
"EnableDebugLog": true,
"DebugLogFilter": "Verbose",
"IamServerUrl": "",
"PlatformServerUrl": "",
"BasicServerUrl": "",
"LobbyServerUrl": "",
"CloudStorageServerUrl": "",
"GameProfileServerUrl": "",
"StatisticServerUrl": "",
"QosManagerServerUrl": "",
"AgreementServerUrl": "",
"LeaderboardServerUrl": "",
"CloudSaveServerUrl": "",
"GameTelemetryServerUrl": "",
"AchievementServerUrl": "",
"UGCServerUrl": "",
"ReportingServerUrl": "",
"SeasonPassServerUrl": "",
"SessionBrowserServerUrl": "",
"SessionServerUrl": "",
"MatchmakingV2ServerUrl": "",
"UseTurnManager": true,
"TurnManagerServerUrl": "",
"TurnServerHost": "",
"TurnServerPort": "",
"TurnServerPassword": "",
"TurnServerSecret": "",
"TurnServerUsername": "",
"PeerMonitorIntervalMs": 200,
"PeerMonitorTimeoutMs": 2000,
"HostCheckTimeoutInSeconds": 60,
"GroupServerUrl": "",
"ChatServerWsUrl": "",
"ChatServerUrl": "",
"GdprServerUrl": "",
"AppId": "",
"CustomerName": "",
"EnableAuthHandshake": false,
"MaximumCacheSize": 100,
"MaximumCacheLifeTime": 100,
"EnablePresenceBroadcastEvent": true,
"PresenceBroadcastEventInterval": 600,
"PresenceBroadcastEventGameState": 0,
"PresenceBroadcastEventGameStateDescription": "",
"EnablePreDefinedEvent": false,
"EnableClientAnalyticsEvent": false,
"ClientAnalyticsEventInterval": 10.0,
"EnableAmsServerQos": false
}
}AccelByteSDKOAuthConfig.json
{
"Default": {
"ClientId": "Required",
"ClientSecret": ""
}
}AccelByteServerSDKConfig.json
{
"Default": {
"Namespace": "Required",
"BaseUrl": "Required",
"RedirectUri": "Required",
"IamServerUrl": null,
"DSHubServerUrl": null,
"DSMControllerServerUrl": null,
"StatisticServerUrl": null,
"UGCServerUrl": null,
"PlatformServerUrl": null,
"QosManagerServerUrl": null,
"GameTelemetryServerUrl": null,
"AchievementServerUrl": null,
"LobbyServerUrl": null,
"SessionServerUrl": null,
"CloudSaveServerUrl": null,
"MatchmakingServerUrl": null,
"MatchmakingV2ServerUrl": null,
"SeasonPassServerUrl": null,
"AMSServerUrl": null,
"WatchdogUrl": null,
"AMSHeartbeatInterval": 15,
"MaximumCacheSize": 100,
"MaximumCacheLifeTime": 100,
"EnablePreDefinedEvent": false,
"StatsDServerUrl": null,
"StatsDServerPort": 0,
"StatsDMetricInterval": 0,
"EnableDebugLog": true,
"DebugLogFilter": "Verbose"
}
}AccelByteServerSDKOAuthConfig.json
{
"Default": {
"ClientId": "Required",
"ClientSecret": ""
}
}他の環境をセットアップする場合も、すべての設定 JSON は同じテンプレートを使用します。例えば、OAuth 設定の場合は次のようになります。
{
"Default": {
"ClientId": "Required",
...
},
"Development": {
"ClientId": "Required",
...
},
"Certification": {
"ClientId": "Required",
...
},
"Production": {
"ClientId": "Required",
...
}
}important- ClientID、Secret、Namespace の設定は、AGS Admin Portal で確認できます。
- AGS Public Cloud の場合は、以下の形式を使用してください。
- Namespace の場合:
<Studio ID>-<Game TitleID> - Publisher の場合:
<Studio ID>。
- Namespace の場合:
- Game Client が Public Client タイプを使用している場合は、Client Secret を空のままにしてください。
- API の URL が分からない場合は、サポートまたはアカウントマネージャーにお問い合わせください。AGS Public Cloud を利用している場合、
base URLはhttps://<Studio ID>-<Game TitleID>.prod.gamingservices.accelbyte.ioです。- 例:
https://mystudio-myawesomegame.prod.gamingservices.accelbyte.io
- 例:
- AGS Unity SDK のログを設定する場合は、AGS Unity SDK ログ設定ガイド を参照してください。
おめでとうございます。AGS SDK for Unity の設定が完了しました。