GS2 UIKit for Unity Tutorial
How to use GS2 UIKit for Unity.
Follow Learn GS2 by building an adventure game to add login, rewards, stamina, and a shop step by step, using Studio or the Unity SDK.
Game Server Services provides SDKs for all major game engines. The SDK for game engines is provided in a higher level API format than the regular SDK, with a focus on use from within the game.
This SDK is distributed under the Apache License 2.0.
You must clearly indicate somewhere in your program that you are using libraries provided under the Apache License 2.0.
This SDK includes LitJson (Gs2/Plugin/LitJSON.dll), which is in the public domain.
This dll is used for operations that are fundamental to the operation of the GS2 SDK and cannot be removed.
This SDK includes websocket-sharp(Gs2/Plugin/websocket-sharp.dll) which is licensed under the MIT License.
The license that should be noted is as follows
https://raw.githubusercontent.com/sta/websocket-sharp/master/LICENSE.txt
This dll is used for operations that are fundamental to the operation of the GS2 SDK, so it cannot be removed.
This SDK includes protobuf (Gs2/Plugin/Google.Protobuf.dll) which is licensed under BSD.
The license that should be noted is as follows
https://github.com/protocolbuffers/protobuf/blob/master/LICENSE
This dll can be removed if you are not using GS2-Realtime.
GS2 SDK for Unity Installer Version 2024.4.1
Download the installer in UnityPackege format from the link above.
Start the Unity Editor and import the gs2-unity-installer_2024.4.1.unitypackage file from the Import Package menu.
Then select “Window > Game Server Services > SDK Installer” from the Unity Editor menu and follow the instructions in the wizard.
If the installation does not work properly after installation is complete, try restarting the Unity Editor once.
Details of the SDK setup procedure
GS2 UIKit for Unity is designed to allow implementation of GS2 functionality using the Unity Editor interface without writing code.
After installing the SDK installer, select “Window > Game Server Services > UIKit for Unity Installer” from the Unity Editor menu and follow the wizard instructions. If the installation does not work properly after the installation is complete, try restarting the Unity Editor once.
For a tutorial on UIKit, see here.
The SDK itself is licensed under the Apache License 2.0.
You need to specify that you are using the library provided under the Apache License 2.0 somewhere in your program.
The latest SDK can be obtained from GitHub.
https://github.com/gs2io/gs2-sdk-for-ue5/
Download the source code from GitHub and place it in the following folder in your Unreal Engine project
(Unreal Engine Project)/Plugins/Gs2Plugin
If the Plugins folder does not exist, create it.
Run uproject in UnrealEditor, activate the GS2 plugin, and restart UnrealEditor.
Detailed SDK Setup Instructions
You can get the Unreal Engine source code from Github or Perforce and install it as an engine plugin in the environment where you are building the Engine.
Place the downloaded source code in the following folder in the Unreal Engine source code.
(Unreal Engine source code)/Engine/Plugins/Gs2Plugin
Run uproject in UnrealEditor, activate the GS2 plugin, and restart UnrealEditor.
This SDK is provided for Godot 4 (GDScript) and is distributed under the Apache License 2.0.
You must clearly indicate somewhere in your program that you are using libraries provided under the Apache License 2.0.
The latest SDK is available from the GitHub releases as a ZIP archive.
https://github.com/gs2io/gs2-sdk-for-godot/releases/latest
Download “Source code (zip)” from the release’s Assets, extract it and copy its addons/gs2 folder into the addons folder of your Godot project.
The installation is complete when the SDK is located at res://addons/gs2/.
The SDKs for Go, PHP, Java, C#, TypeScript, and Python let you call GS2 APIs from your applications or custom backends. For game development with Unity, Unreal Engine 5, or Godot, install the corresponding SDK from the “Game Engine” section above.
Select your language tab and run the installation command in your project folder.
Install Go and run the command in the folder containing go.mod. For a new project, first create a module with go mod init example.com/gs2-sample.
go get github.com/gs2io/gs2-golang-sdk@latestThe SDK is a library used by your application, so add it as a dependency with go get.
Verify installation: The following command should display the module name and version.
go list -m github.com/gs2io/gs2-golang-sdkSource code and requirements (GitHub) · Package details (pkg.go.dev)
Install PHP and Composer, then run the command in your project folder.
composer require gs2/gs2-php-sdkLoad the autoloader generated by Composer before using the SDK. In a PHP file at the project root, use:
require __DIR__ . '/vendor/autoload.php';Verify installation: The following command should display the package details and version.
composer show gs2/gs2-php-sdkSource code and requirements (GitHub) · Package details (Packagist)
Install a JDK and Maven, then add the following dependency inside <dependencies> in your project’s pom.xml.
Replace YOUR_SDK_VERSION with a version number from Versions on Maven Central.
<dependency>
<groupId>io.gs2</groupId>
<artifactId>gs2-java-sdk</artifactId>
<version>YOUR_SDK_VERSION</version>
</dependency>Verify installation: Run the following command in the folder containing pom.xml and check that it lists io.gs2:gs2-java-sdk with the selected version. If you use an IDE, reload the Maven project.
mvn dependency:tree -Dincludes=io.gs2:gs2-java-sdkSource code and requirements (GitHub) · Package details (Maven Central)
Install the .NET SDK and run the command in the folder containing your .csproj file.
dotnet add package GS2.CSharp.SdkIn Visual Studio, you can also search for GS2.CSharp.Sdk in “Manage NuGet Packages” for your project and install it there.
Verify installation: The following command should list GS2.CSharp.Sdk and its version.
dotnet list packageFor Unity installation instructions, see the SDK installation reference.
Source code and requirements (GitHub) · Package details (NuGet)
Install Node.js and npm, then run the command in the folder containing package.json. For a new project, first create package.json with npm init -y.
npm install gs2Verify installation: The following command should list gs2 and its version.
npm list gs2Source code (GitHub) · Package details and requirements (npm)
Install Python and run the command in the Python environment used by your project. If you use a virtual environment, activate it first.
python -m pip install gs2python -m pip installs the SDK into the environment of the Python interpreter you run. If your environment uses python3 instead of python, replace python with python3 in these commands.
Verify installation: The following command should display the package details and version.
python -m pip show gs2Source code and requirements (GitHub) · Package details (PyPI)
CDK stands for Cloud Development Kit, a development kit that enables GS2 orchestration in code.
To explain the functionality more concretely, you can write code to instantiate an object corresponding to a GS2 resource in the CDK and call the Dump API to generate a GS2 Deploy template. GS2-Deploy templates can be written in YAML format, but because YAML files are not program code, they cannot import external files or execute loops, and to optimize the workflow it was necessary to write code to generate templates. CDK is a solution to streamline such a workflow, allowing you to parse master data Excel files and generate GS2-Deploy templates while defining event durations in a loop within the tool using CDK.
Select your language tab and run the installation command in your project folder.
Install Go and run the command in the folder containing go.mod. For a new project, first create a module with go mod init example.com/gs2-cdk-sample.
go get github.com/gs2io/gs2-golang-cdk@latestThe CDK is a library used by your application, so add it as a dependency with go get.
Verify installation: The following command should display the module name and version.
go list -m github.com/gs2io/gs2-golang-cdkSource code and requirements (GitHub) · Package details (pkg.go.dev)
Install PHP and Composer, then run the command in your project folder.
composer require gs2/gs2-php-cdkLoad the autoloader generated by Composer before using the CDK. In a PHP file at the project root, use:
require __DIR__ . '/vendor/autoload.php';Verify installation: The following command should display the package details and version.
composer show gs2/gs2-php-cdkSource code and requirements (GitHub) · Package details (Packagist)
Install a JDK and Maven, then add the following dependency inside <dependencies> in your project’s pom.xml.
Replace YOUR_CDK_VERSION with a version number from Versions on Maven Central.
<dependency>
<groupId>io.gs2</groupId>
<artifactId>gs2-java-cdk</artifactId>
<version>YOUR_CDK_VERSION</version>
</dependency>Verify installation: Run the following command in the folder containing pom.xml and check that it lists io.gs2:gs2-java-cdk with the selected version. If you use an IDE, reload the Maven project.
mvn dependency:tree -Dincludes=io.gs2:gs2-java-cdkSource code and requirements (GitHub) · Package details (Maven Central)
Install the .NET SDK and run the command in the folder containing your .csproj file.
dotnet add package GS2.CSharp.CdkIn Visual Studio, you can also search for GS2.CSharp.Cdk in “Manage NuGet Packages” for your project and install it there.
Verify installation: The following command should list GS2.CSharp.Cdk and its version.
dotnet list packageSource code and requirements (GitHub) · Package details (NuGet)
Install Node.js and npm, then run the command in the folder containing package.json. For a new project, first create package.json with npm init -y.
npm install gs2-cdkVerify installation: The following command should list gs2-cdk and its version.
npm list gs2-cdkSource code (GitHub) · Package details and requirements (npm)
Install Python and run the command in the Python environment used by your project. If you use a virtual environment, activate it first.
python -m pip install gs2-cdkpython -m pip installs the CDK into the environment of the Python interpreter you run. If your environment uses python3 instead of python, replace python with python3 in these commands.
Verify installation: The following command should display the package details and version.
python -m pip show gs2-cdkSource code and requirements (GitHub) · Package details (PyPI)
Next, let’s try the Tutorial to see GS2 in action.
How to use GS2 UIKit for Unity.
implement GS2-SDK for UE5 Blueprint to create an account and login
Install the GS2 SDK for Unity, Unreal Engine, and Godot
Build a small adventure game step by step, from login to rewards and a shop.