Subscribing to changes in the achievements system
#
You can listen for changes in the achievements system so that you can respond appropriately, such as updating the UI, by implementing the appropriate interface.
1
2
3
4
5
vardisposer=SystemObserver<AchievementsSystem>.Create(leaderboardsSystem,system=>{Instance.Logger.Info($"System updated.");// Update UI elements etc as necessary here...});
foreach(varachievementKvpinachievementsSystem.Achievements){varid=achievementKvp.Key;varachievement=achievementKvp.Value;Debug.Log($"Achievement {achievement.Name} ({achievement.Category})");Debug.Log(achievement.Description);if(achievement.HasReward()){Debug.Log("Reward available on completion");}if(achievement.SubAchievements.Any()){Debug.Log($"{achievement.SubAchievements.Count} sub-achievements.");}}
You can also list all repeatable achievements for the user.
You can claim rewards for an achievement. You can also specify whether you would like to claim any available total rewards (e.g. if the user has completed all sub-achievements) as well as whether or not to refresh the Economy System.