CloudOnce v2.7.5
Unified Game Services API
CloudOnce.Internal.UnifiedAchievement Class Reference

A cross-platform achievement. Class has methods for unlocking, revealing and incrementing the achievement that will work for all supported platforms. Only intended to be used by CloudOnce internal classes. More...

Public Member Functions

 UnifiedAchievement (string internalID, string platformID)
 A cross-platform achievement. Class has methods for unlocking, revealing and incrementing the achievement that will work for all supported platforms. More...
 
void Unlock (Action< CloudRequestResult< bool > > onComplete=null)
 Unlocks this achievement. More...
 
void Reveal (Action< CloudRequestResult< bool > > onComplete=null)
 Reveals this achievement. More...
 
void Increment (double current, double goal, Action< CloudRequestResult< bool > > onComplete=null)
 Increments this achievement. More...
 
void Increment (double progress, Action< CloudRequestResult< bool > > onComplete=null)
 Increments this achievement. More...
 
void UpdateData (bool isUnlocked, double progress, bool isHidden)
 Updates locked status and progress with data received from native API. More...
 
void ResetLocalState ()
 

Properties

string ID [get]
 The ID for the current platform.
 
bool IsUnlocked [get]
 Whether or not this achievement has been unlocked.
 
double Progress [get]
 The current progress of this achievement, represented as a number between 0.0 and 100.0.
 

Detailed Description

A cross-platform achievement. Class has methods for unlocking, revealing and incrementing the achievement that will work for all supported platforms. Only intended to be used by CloudOnce internal classes.

Constructor & Destructor Documentation

◆ UnifiedAchievement()

CloudOnce.Internal.UnifiedAchievement.UnifiedAchievement ( string  internalID,
string  platformID 
)
inline

A cross-platform achievement. Class has methods for unlocking, revealing and incrementing the achievement that will work for all supported platforms.

Parameters
internalIDThe internal ID for this achievement.
platformIDThe current platform ID for this achievement. Set to string.Empty if platform is not supported.

Member Function Documentation

◆ Increment() [1/2]

void CloudOnce.Internal.UnifiedAchievement.Increment ( double  current,
double  goal,
Action< CloudRequestResult< bool > >  onComplete = null 
)
inline

Increments this achievement.

Will calculate progress from current and goal .

Progress of 0.0 will reveal the achievement and 100.0 will unlock it.

Parameters
currentCurrent progress of achievement.
goalTotal amount of steps to unlock achievement.
onCompleteCallback that will be called to report the result of the operation: true on success, false otherwise. If false, an error message will be included in the callback.

◆ Increment() [2/2]

void CloudOnce.Internal.UnifiedAchievement.Increment ( double  progress,
Action< CloudRequestResult< bool > >  onComplete = null 
)
inline

Increments this achievement.

Can also be used to reveal or unlock this achievement.

A progress of 0.0 will reveal the achievement and 100.0 will unlock it.

Parameters
progressThe current progress of this achievement, represented as a number between 0.0 and 100.0. A progress of 0.0 will reveal the achievement and 100.0 will unlock it.

This value is interpreted as the total percentage of the achievement's progress that the player should have as a result of this call (regardless of the progress they had before). So if the player's previous progress was 30% and this call specifies 50.0, the new progress will be 50% (not 80%).

Parameters
onCompleteCallback that will be called to report the result of the operation: true on success, false otherwise. If false, an error message will be included in the callback.

◆ Reveal()

void CloudOnce.Internal.UnifiedAchievement.Reveal ( Action< CloudRequestResult< bool > >  onComplete = null)
inline

Reveals this achievement.

Parameters
onCompleteCallback that will be called to report the result of the operation: true on success, false otherwise. If false, an error message will be included in the callback.

◆ Unlock()

void CloudOnce.Internal.UnifiedAchievement.Unlock ( Action< CloudRequestResult< bool > >  onComplete = null)
inline

Unlocks this achievement.

Parameters
onCompleteCallback that will be called to report the result of the operation: true on success, false otherwise. If false, an error message will be included in the callback.

◆ UpdateData()

void CloudOnce.Internal.UnifiedAchievement.UpdateData ( bool  isUnlocked,
double  progress,
bool  isHidden 
)
inline

Updates locked status and progress with data received from native API.

Only intended to be used by internal CloudOnce systems.

Parameters
isUnlockedWhether or not this achievement has been unlocked.
progressThe current progress of this achievement, represented as a number between 0.0 and 100.0.
isHiddenWhether or not this achievement is hidden.

The documentation for this class was generated from the following file: