PlayerIO

The fastest way to build online games without breaking a sweat.

Unity3D Client Reference

Multiplayer  class documentationClass Achievements

Namespace: PlayerIOClient
Language: C# / .NET

The Player.IO Achievements service

Properties

 
public Achievement[]
MyAchievements  [read-only]

The list of all achievements; the values of Progress and ProgressGoal will indicate whether the achievement is started/pending/complete.

Methods

 
public void
AddOnComplete (AchievementCompletedEventHandler onCompleteHandler)

Add a handler to the OnComplete event

public Achievement
Get (string achievementId)

This method gets the specified achievement

public void
ProgressAdd (string achievementId, int progressDelta, Callback<Achievement> successCallback)

Add or subtract from the current progress of an achievement.

public void
ProgressAdd (string achievementId, int progressDelta, Callback<Achievement> successCallback, Callback<PlayerIOError> errorCallback)

Add or subtract from the current progress of an achievement.

public void
ProgressComplete (string achievementId, Callback<Achievement> successCallback)

Complete the specified achievement, by setting the progress to the maximum (ProgressGoal) of the achievement.

public void
ProgressComplete (string achievementId, Callback<Achievement> successCallback, Callback<PlayerIOError> errorCallback)

Complete the specified achievement, by setting the progress to the maximum (ProgressGoal) of the achievement.

public void
ProgressMax (string achievementId, int progress, Callback<Achievement> successCallback, Callback<PlayerIOError> errorCallback)

Sets the current progress value to the bigger value of progress or the current value, i.e; newProgress = Max(currentProgress,progress)

public void
ProgressMax (string achievementId, int progress, Callback<Achievement> successCallback)

Sets the current progress value to the bigger value of progress or the current value, i.e; newProgress = Max(currentProgress,progress)

public void
ProgressSet (string achievementId, int progress, Callback<Achievement> successCallback, Callback<PlayerIOError> errorCallback)

Sets the progress of the specified achievement.

public void
ProgressSet (string achievementId, int progress, Callback<Achievement> successCallback)

Sets the progress of the specified achievement.

public void
Refresh (Callback successCallback)

Refreshes MyAchievements

public void
Refresh (Callback successCallback, Callback<PlayerIOError> errorCallback)

Refreshes MyAchievements

Achievements.MyAchievements

public Achievement[]
MyAchievements  [read-only]

The list of all achievements; the values of Progress and ProgressGoal will indicate whether the achievement is started/pending/complete.

Achievements.AddOnComplete

public void
AddOnComplete (AchievementCompletedEventHandler onCompleteHandler)

Add a handler to the OnComplete event

Arguments

AchievementCompletedEventHandler onCompleteHandler

Achievements.Get

public Achievement
Get (string achievementId)

This method gets the specified achievement

Arguments

string achievementId
The id of the achievement to get

Achievements.ProgressAdd

public void
ProgressAdd (string achievementId, int progressDelta, Callback<Achievement> successCallback)

Add or subtract from the current progress of an achievement.

Arguments

string achievementId
The id of the achievement to add progress to.
int progressDelta
The delta value that will be added to the current progress of the achievement.
Callback<Achievement> successCallback
Callback that will be called with the updated Achievement.

Achievements.ProgressAdd

public void
ProgressAdd (string achievementId, int progressDelta, Callback<Achievement> successCallback, Callback<PlayerIOError> errorCallback)

Add or subtract from the current progress of an achievement.

Arguments

string achievementId
The id of the achivement to add progress to.
int progressDelta
The delta value that will be added to the current progress of the achievement.
Callback<Achievement> successCallback
Callback that will be called with the updated Achievement.
Callback<PlayerIOError> errorCallback
Callback that will be called instead of successCallback if an error occurs.

Achievements.ProgressComplete

public void
ProgressComplete (string achievementId, Callback<Achievement> successCallback)

Complete the specified achievement, by setting the progress to the maximum (ProgressGoal) of the achievement.

Arguments

string achievementId
The id of the achievement to complete.
Callback<Achievement> successCallback
Callback that will be called with the updated Achievement.

Achievements.ProgressComplete

public void
ProgressComplete (string achievementId, Callback<Achievement> successCallback, Callback<PlayerIOError> errorCallback)

Complete the specified achievement, by setting the progress to the maximum (ProgressGoal) of the achievement.

Arguments

string achievementId
The id of the achivement to complete.
Callback<Achievement> successCallback
Callback that will be called with the updated Achievement.
Callback<PlayerIOError> errorCallback
Callback that will be called instead of successCallback if an error occurs.

Achievements.ProgressMax

public void
ProgressMax (string achievementId, int progress, Callback<Achievement> successCallback, Callback<PlayerIOError> errorCallback)

Sets the current progress value to the bigger value of progress or the current value, i.e; newProgress = Max(currentProgress,progress)

Arguments

string achievementId
The id of the achivement to work on.
int progress
The possible new progress value that should be compared to the current progress value
Callback<Achievement> successCallback
Callback that will be called with the updated Achievement.
Callback<PlayerIOError> errorCallback
Callback that will be called instead of successCallback if an error occurs.

Achievements.ProgressMax

public void
ProgressMax (string achievementId, int progress, Callback<Achievement> successCallback)

Sets the current progress value to the bigger value of progress or the current value, i.e; newProgress = Max(currentProgress,progress)

Arguments

string achievementId
The id of the achievement to work on.
int progress
The possible new progress value that should be compared to the current progress value
Callback<Achievement> successCallback
Callback that will be called with the updated Achievement.

Achievements.ProgressSet

public void
ProgressSet (string achievementId, int progress, Callback<Achievement> successCallback, Callback<PlayerIOError> errorCallback)

Sets the progress of the specified achievement.

Arguments

string achievementId
The id of the achivement to add progress to.
int progress
The new progress value for the achievement.
Callback<Achievement> successCallback
Callback that will be called with the updated Achievement.
Callback<PlayerIOError> errorCallback
Callback that will be called instead of successCallback if an error occurs.

Achievements.ProgressSet

public void
ProgressSet (string achievementId, int progress, Callback<Achievement> successCallback)

Sets the progress of the specified achievement.

Arguments

string achievementId
The id of the achievement to add progress to.
int progress
The new progress value for the achievement.
Callback<Achievement> successCallback
Callback that will be called with the updated Achievement.

Achievements.Refresh

public void
Refresh (Callback successCallback)

Refreshes MyAchievements

Arguments

Callback successCallback
Callback that will be called when the refresh is complete.

Achievements.Refresh

public void
Refresh (Callback successCallback, Callback<PlayerIOError> errorCallback)

Refreshes MyAchievements

Arguments

Callback successCallback
Callback that will be called when the refresh is complete.
Callback<PlayerIOError> errorCallback
Callback that will be called instead of successCallback if an error occurs.