Account(GS2 UIKit for Unity) のサンプル
GS2 UIKit for Unity を使用した GS2-Account の機能実装サンプルの紹介
GS2 UIKit for Unity の機能実装サンプルです。
https://github.com/gs2io/gs2-uikit-sample
GS2 UIKit Sample Version 2022.10.1
上記よりサンプルパッケージファイルをダウンロードします。 Unity Hub を起動し、サンプルの展開用の 新しいプロジェクト を作成します。 もしくは、Unity Editorを起動しプロジェクトを新規作成します。 Unity Editorの Assets メニューの Import Package から 上記unitypackage ファイルをプロジェクトにインポートします。
サンプルを実行するための準備を行います。 ここでは例として、GS2-Experienceで経験値を表示するサンプルを実行する手順について扱います。
サンプルをインポートしたプロジェクトで、シーンを開きます。 ここでは例としてExperience.unityファイルを開いています。
Experience サンプルシーン: (Unityプロジェクト)/Assets/Game Server Services/Samples/UIKit/Gs2Experience/Scenes/Experience.unity
UnityクライアントからGS2へのアクセスのためのクレデンシャル(認証情報) の設定を行います。 GS2のマネージメントコンソールでプロジェクトを作成してください。 マネージメントコンソールの GS2-Deploy の スタックの新規作成 で、以下のテンプレートファイルでスタックを作成してください。
クレデンシャルを設定するテンプレートのパス: (Unityプロジェクト)/Assets/Game Server Services/Samples/UIKit/Core/Settings/initialize_credential_template.yaml
スタックのアウトプットの ApplicationClientId
、ApplicationClientSecret
の値を、以下の SampleEnvironment.asset に設定します。
(Unityプロジェクト)/Assets/Game Server Services/Samples/UIKit/Core/Settings/SampleEnvironment.asset
フィールド名 | 条件 |
---|---|
Name | プロジェクト名 |
Region | リージョン |
Client Id | クレデンシャルのClientId |
Client Secret | クレデンシャルのClientSecret |
サンプルの動作に必要なリソースの準備を行います。 マネージメントコンソールの GS2-Deploy の スタックの新規作成 で以下のテンプレートファイルでスタックを作成してください。 スタック名には例として Experience、説明文は任意で設定、テンプレートデータでファイルを選択し、テンプレートをアップロードします。
経験値を設定するテンプレートのパス: (Unityプロジェクト)/Assets/Game Server Services/Samples/UIKit/Gs2Experience/Settings/initialize_experience_template.yaml
実行状態が作成完了になれば設定は完了です。
GS2 UIKit for Unity を使用した GS2-Account の機能実装サンプルの紹介
GS2 UIKit for Unity を使用した GS2-Chat の機能実装サンプルの紹介
GS2 UIKit for Unity を使用した GS2-Dictionary の機能実装サンプルの紹介
GS2 UIKit for Unity を使用した GS2-Exchange の機能実装サンプルの紹介
GS2 UIKit for Unity を使用した GS2-Experience の機能実装サンプルの紹介
GS2 UIKit for Unity を使用した GS2-Formation の機能実装サンプルの紹介
GS2 UIKit for Unity を使用した GS2-Friend の機能実装サンプルの紹介
GS2 UIKit for Unity を使用した GS2-Inbox の機能実装サンプルの紹介
GS2 UIKit for Unity を使用した GS2-Inventory の機能実装サンプルの紹介
GS2 UIKit for Unity を使用した GS2-Mission の機能実装サンプルの紹介
GS2 UIKit for Unity を使用した GS2-Money の機能実装サンプルの紹介
GS2 UIKit for Unity を使用した GS2-Quest の機能実装サンプルの紹介
GS2 UIKit for Unity を使用した GS2-Showcase の機能実装サンプルの紹介
GS2 UIKit for Unity を使用した GS2-Stamina の機能実装サンプルの紹介