Unity
Unity integration
Introduction
Achievements can be used to reward the player following some specific actions in your game. He can be rewarded with currencies, virtual items, progression or leaderboard score.
Get game achievements
using UnityEngine;
using RGN.Modules.Achievement;
using System.Collections.Generic;
public class AchievementExamples : MonoBehaviour
{
private async void GetAllGameAchievements()
{
// Retrieves the 10 first achievements setup for my game
List<AchievementData> achievements = await AchievementsModule.I.GetForCurrentAppAsync(10);
foreach (var achievement in achievements)
{
Debug.Log($"Achievement name : {achievement.name} \n" +
$"Description : {achievement.description}");
}
}
}Get user achievements
This function returns the completed and on going achievements for the user.
Trigger achievement by id
Trigger achievement by request name
The request name can be set in the developer dashboard when creating the achievement.
Claim achievement by id
If the achievement is not set to be automatically claimed when completed, you can claim it in game to show to the player the rewards he received.
Claim achievement by request name
If the achievement is not set to be automatically claimed when completed, you can claim it in game to show to the player the rewards he received.
The request name can be set in the developer dashboard when creating the achievement.
Last updated
Was this helpful?