userachievementmanager - TogetherGames/Public-Unity-CSharp GitHub Wiki

UserAchievementManager

together.UserAchievementManager

Overview

The USerAchievementManager is used for fetching and finding achievements that exist for the current user.


Members

List<UserAchievement> UserAchievements

Stores all the UserAchievements contained in the Manager.


Methods


Add()

Adds a UserAchievement to the internally managed list without persistence.

Note
This method is deprecated

Returns void
Syntax
UserAchievementManager.Add( userAchievement )
Parameters

UserAchievement userAchievement

Instance of a UserAchievement to add internally

--------------------------------------------------------------------------------

FindByUserAchievementID()

Finds the UserAchievement with the specified UserAchievementID if it exists, otherwise returns null.

Syntax
UserAchievementManager.FindByUserAchievementID( userAchievementID )
Parameters

long userAchievementID

The ID of the UserAchievement to find

--------------------------------------------------------------------------------

FindByAchievementID()

Finds the UserAchievement with the specified AchievementID if it exists, otherwise returns null.

Syntax
UserAchievementManager.FindByAchievementID( achievementID )
Parameters

long achievementID

The ID of the Achievement to find

--------------------------------------------------------------------------------

GetCount()

Gets the number of UserAchievements currently managed internally.

Returns int
Syntax
UserAchievementManager.GetCount(  )

Get()

Gets the UserAchievement at the specified index if it exists, otherwise returns null.

Syntax
UserAchievementManager.Get( index )
Parameters

int index

The index of the UserAchievement to find

--------------------------------------------------------------------------------

IndexOf()

Returns the index of the specified UserAchievement if it exists, otherwise returns -1.

Returns int
Syntax
UserAchievementManager.IndexOf( userAchievement )
Parameters

UserAchievement userAchievement

Instance of the UserAchievement to find the index of

--------------------------------------------------------------------------------

IndexOfByUserAchievementID()

Returns the index of the UserAchievement with the specified UserAchievementID if it exists, otherwise returns -1.

Returns int
Syntax
UserAchievementManager.IndexOfByUserAchievementID( userAchievementID )
Parameters

long userAchievementID

The ID of the UserAchievement to find the index of

--------------------------------------------------------------------------------

IndexOfByAchievementID()

Returns the index of the UserAchievement with the specified AchievementID if it exists, otherwise returns -1.

Returns int
Syntax
UserAchievementManager.IndexOfByAchievementID( achievementID )
Parameters

long achievementID

The ID of the Achievement to find the index of

--------------------------------------------------------------------------------

Remove()

Removes a UserAchievement from the internally managed list. This does not delete the user achievement from the session's account persistently.

Note
This method is deprecated

Returns void
Syntax
UserAchievementManager.Remove( index )
Parameters

int index

The index of the UserAchievement to be removed.

--------------------------------------------------------------------------------

PopulateFrom()

Does a one for one copy of the user achievements contained in the passed manager to this manager.

Note
This method is deprecated

Returns void
Syntax
UserAchievementManager.PopulateFrom( manager )
Parameters

UserAchievementManager manager

The manager to copy from

--------------------------------------------------------------------------------

Award()

Awards a UserAchievement. Upon success, this will automatically update the internal list.

Returns void
Syntax
UserAchievementManager.Award( achievementID, actionName, roomID, userAchievementProperties, notificationMessage, callbackFunc )
Parameters

long achievementID

The ID of the Achievement to award.

[string](#) actionName

The Action of the Achievements to award.

[long](#) roomID

The ID of the Room the UserAchievement is being awarded in.

[PropertyCollection](./propertycollection) userAchievementProperties

The properties to assign to the UserAchievement. Pass in null to assign no properties.

[string](#) notificationMessage

The notification message to send to the User. Pass in "" if no notification should be sent.

[OnCompleteHandler](./oncompletehandler) callbackFunc

The function to call upon completion.

--------------------------------------------------------------------------------

Delete()

Deletes a UserAchievement. Upon success, this will automatically update the internal list.

Returns void
Syntax
UserAchievementManager.Delete( userAchievementID, callbackFunc )
Parameters

long userAchievementID

The ID of the UserAchievement to delete.

[OnCompleteHandler](./oncompletehandler) callbackFunc

The function to call upon completion.

--------------------------------------------------------------------------------

GetAll()

Gets all UserAchievements assigned to the User. Upon success, this will automatically update the internal list.

Returns void
Syntax
UserAchievementManager.GetAll( callbackFunc )
Parameters

OnCompleteHandler callbackFunc

The function to call upon completion.

--------------------------------------------------------------------------------

Purchase()

Purchases a UserAchievement. Upon success, this will automatically update the internal list.

Note
This method is deprecated

Returns void
Syntax
UserAchievementManager.Purchase( achievementID, roomID, userAchievementProperties, callbackFunc )
Parameters

long achievementID

The ID of the Achievement to purchase.

[long](#) roomID

The ID of the Room the UserAchievement is being purchased in.

[PropertyCollection](./propertycollection) userAchievementProperties

The properties to assign to the UserAchievement. Pass in null to assign no properties.

[OnCompleteHandler](./oncompletehandler) callbackFunc

The function to call upon completion.

--------------------------------------------------------------------------------

Sell()

Sells a UserAchievement. Upon success, this will automatically update the internal list.

Note
This method is deprecated

Returns void
Syntax
UserAchievementManager.Sell( userAchievementID, callbackFunc )
Parameters

long userAchievementID

The ID of the Achievement to sell.

[OnCompleteHandler](./oncompletehandler) callbackFunc

The function to call upon completion.

--------------------------------------------------------------------------------
⚠️ **GitHub.com Fallback** ⚠️