Getting Started
Introduction
ArenaGamesSDK is a user-friendly drag-and-drop solution that enables developers to effortlessly harness the capabilities of ArenaGames and Web3. It serves as a dedicated custom wrapper for our API, simplifying integration.
Features:
- Drag and drop solution.
- Account System
- Leaderboards
- Achievements
- NFT Tracking (Work in Progress)
Setting Up
Importing the package
Now that you have downloaded your shiny new package, feel free to go ahead and import it into your project.
After a successful import, it`s crucial to set up the configuration file correctly. Locate the configuration file by clicking on `Window` > `Arena Games` > `Highlight ArenaGames settings` (as shown below).
Configuring Options
After locating the configuration file, please configure it correctly. Necessary information will be provided by ArenaGames
- Game Name - Full name of your game.
- Game Alias - A special identifier of your game (will be provided by ArenaGames).
- Leaderboard Id - A special identifier of your game leaderboards (will be provided by ArenaGames).
- Server Token - A special token for authentication purposes (will be provided by ArenaGames).
- IsProd - This checkmark, toggles between a DEV and Live environments. On - Live, Off - DEV.
Adding Prefab
After successfully configuring your settings, navigate to `ArenaGames > Prefabs` folder. You`ll find several prefabs designed for both horizontal and vertical screens. Select the one that best suits your game and drag-and-drop it into your initial scene.
Initializing ArenaGames SDK
To initialize ArenaGames, you need to prompt a signin, the rest will be handled by the SDK. Here is an example:
using UnityEngine;
public class DemoController : MonoBehaviour
{
void Start()
{
ArenaGamesController.Instance.StartSignInProcess();
}
}
Leaderboards
Posting a score
using UnityEngine;
public class DemoController : MonoBehaviour
{
public void PostToLeaderboard()
{
int _Score = 10;
ArenaGamesController.Instance.m_NetworkController.UpdateToLeaderboard(_Score);
}
}
Achievements
Updating achievement progress
You can create achievements on the ArenaGames dashboard. Essentially, these achievements act like variables that can be increased. Each achievement has a condition for completion. Let`s take an example achievement: `Kill 10 enemies.` It will be completed once its value reaches 10. The following script increments this achievement by one. Achievement IDs are provided from the ArenaGames dashboard.
using UnityEngine;
public class DemoController : MonoBehaviour
{
private void Start()
{
string _AchievementId = "Achievement_Kill_10";
int _IncrementAmount = 1;
ArenaGamesController.Instance.m_NetworkController.ProgressAchievement(_AchievementId, _IncrementAmount);
}
}