Legacy Documentation: Version 5.1
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Social.LoadAchievements

Switch to Manual
public static function LoadAchievements(callback: Action<IAchievement[]>): void;

Parameters

Description

Load the achievements the logged in user has already achieved or reported progress on.

function Start () {
	Social.localUser.Authenticate (ProcessAuthentication);
}
	
function ProcessAuthentication (success: boolean) {
	if (success) {
		Debug.Log ("Authenticated, checking achievements");
		Social.LoadAchievements( function(cache) {
			Debug.Log ("Got " + cache.Length + " achievements");
		});
	}
	else
		Debug.Log ("Failed to authenticate");
}