GS2 UIKit for Unity の実装サンプル

GS2 UIKit for Unity の実装サンプルの紹介

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で経験値を表示するサンプルを実行する手順について扱います。

Unityでサンプルシーンを開く

サンプルをインポートしたプロジェクトで、シーンを開きます。 ここでは例としてExperience.unityファイルを開いています。

img.png

Experience サンプルシーン: (Unityプロジェクト)/Assets/Game Server Services/Samples/UIKit/Gs2Experience/Scenes/Experience.unity

クレデンシャルの設定

UnityクライアントからGS2へのアクセスのためのクレデンシャル(認証情報) の設定を行います。 GS2のマネージメントコンソールでプロジェクトを作成してください。 マネージメントコンソールの GS2-Deploy の スタックの新規作成 で、以下のテンプレートファイルでスタックを作成してください。

img_1.png

クレデンシャルを設定するテンプレートのパス: (Unityプロジェクト)/Assets/Game Server Services/Samples/UIKit/Core/Settings/initialize_credential_template.yaml

スタックのアウトプットの ApplicationClientIdApplicationClientSecret の値を、以下の SampleEnvironment.asset に設定します。

img_2.png

(Unityプロジェクト)/Assets/Game Server Services/Samples/UIKit/Core/Settings/SampleEnvironment.asset

フィールド名条件
Nameプロジェクト名
Regionリージョン
Client IdクレデンシャルのClientId
Client SecretクレデンシャルのClientSecret

Deploy テンプレートの設定

サンプルの動作に必要なリソースの準備を行います。 マネージメントコンソールの GS2-Deploy の スタックの新規作成 で以下のテンプレートファイルでスタックを作成してください。 スタック名には例として Experience、説明文は任意で設定、テンプレートデータでファイルを選択し、テンプレートをアップロードします。

img_3.png

経験値を設定するテンプレートのパス: (Unityプロジェクト)/Assets/Game Server Services/Samples/UIKit/Gs2Experience/Settings/initialize_experience_template.yaml

実行状態が作成完了になれば設定は完了です。


Account(GS2 UIKit for Unity) のサンプル

GS2 UIKit for Unity を使用した GS2-Account の機能実装サンプルの紹介

Chat(GS2 UIKit for Unity) のサンプル

GS2 UIKit for Unity を使用した GS2-Chat の機能実装サンプルの紹介

Dictionary(GS2 UIKit for Unity) のサンプル

GS2 UIKit for Unity を使用した GS2-Dictionary の機能実装サンプルの紹介

Exchange(GS2 UIKit for Unity) のサンプル

GS2 UIKit for Unity を使用した GS2-Exchange の機能実装サンプルの紹介

Experience(GS2 UIKit for Unity) のサンプル

GS2 UIKit for Unity を使用した GS2-Experience の機能実装サンプルの紹介

Formation(GS2 UIKit for Unity) のサンプル

GS2 UIKit for Unity を使用した GS2-Formation の機能実装サンプルの紹介

Friend(GS2 UIKit for Unity) のサンプル

GS2 UIKit for Unity を使用した GS2-Friend の機能実装サンプルの紹介

Inbox(GS2 UIKit for Unity) のサンプル

GS2 UIKit for Unity を使用した GS2-Inbox の機能実装サンプルの紹介

Inventory(GS2 UIKit for Unity) のサンプル

GS2 UIKit for Unity を使用した GS2-Inventory の機能実装サンプルの紹介

Mission(GS2 UIKit for Unity) のサンプル

GS2 UIKit for Unity を使用した GS2-Mission の機能実装サンプルの紹介

Money(GS2 UIKit for Unity) のサンプル

GS2 UIKit for Unity を使用した GS2-Money の機能実装サンプルの紹介

Quest(GS2 UIKit for Unity) のサンプル

GS2 UIKit for Unity を使用した GS2-Quest の機能実装サンプルの紹介

Showcase(GS2 UIKit for Unity) のサンプル

GS2 UIKit for Unity を使用した GS2-Showcase の機能実装サンプルの紹介

Stamina(GS2 UIKit for Unity) のサンプル

GS2 UIKit for Unity を使用した GS2-Stamina の機能実装サンプルの紹介