Install the Unity SDK
You can use our Unity SDK to implement AccelByte Gaming Services (AGS) Starter’s services into your game. The SDK acts as a bridge between your game and our Starter services.
Download Unity SDKPrerequisites
- Create a new Game Title
- Download the configuration file for Unity and keep the file for the installations
AGS Starter currently supports Unity versions 2019.2 and 2019.4 upwards.
Make sure to use the following format for the BaseUrl, otherwise your API calls may return an error due to a domain mismatch:
https://<Game TitleID>.<environment name>.gamingservices.accelbyte.io
- You can check your game title ID here.
- Use the
dev
value since you’ll be working on a development environment. For example: https://spaceshooter.dev.gamingservices.accelbyte.io - Use the
prod
value when you ready to launch to live environment. For example https://spaceshooter.prod.gamingservices.accelbyte.io
Are you ready to launch your game to the world? Please follow these steps to Create an Account for the Live Environment
Install and Configure
In this tutorial, you will learn how to download and install AccelByte AGS Starter's Unity SDK, and set up your AccelByte Config file.
Create a Project.
Go to Window > Package Manager > + > Add package from git URL…, paste https://github.com/AccelByte/accelbyte-unity-sdk.git#15.12.0 into the pop-up, and click Add.
NOTEPlease make sure to download version 15.12.0.
a. If you are using Assembly Definitions in your project, you may need to add the com.accelbyte.UnitySDK assembly as a reference to your relevant definitions.
b. You must have Git installed and configured on your computer in order for Unity to use a UPM Package.
Copy the files that you downloaded earlier with the names of AccelByteSDKConfig.json and AccelByteSDKOAuthconfig.json and paste them to the Assets/Resource directory.
The contents of both these JSON files should be as follows:
AccelByteSDKConfig.json
{
"Default": {
"Namespace": "Game Namespace",
"UsePlayerPrefs": true,
"EnableDebugLog": true,
"DebugLogFilter": "Log",
"BaseUrl": "<baseUrl>",
"RedirectUri": "http://127.0.0.1",
"AppId": "",
"PublisherNamespace": ""
}
}AccelByteSDKOAuthConfig.json
{
"Default": {
"ClientId": "<OAuth Client ID>",
"ClientSecret": "<OAuth Client Secret>"
}
}
Leave the Client Secret empty if the Game Client uses Public Client Type. Leave the Publisher Name parameter empty as well.
Congratulations! You have successfully configured the SDK for use in Unity.
Proceed to the next section to learn how to implement the IAM Login