Combu  3.2.2
Unity API Documentation
Public Member Functions | Static Public Member Functions | Properties | List of all members
Combu.CombuPlatform Class Reference

Combu Platform implementation of Unity built-in Social interfaces (ISocialPlatform). More...

Inheritance diagram for Combu.CombuPlatform:

Public Member Functions

virtual void Authenticate (ILocalUser user, System.Action< bool > callback)
 Authenticates the user. More...
 
virtual void Authenticate (string username, string password, System.Action< bool, string > callback)
 Authenticates the user with specified username and password. More...
 
virtual void Authenticate< T > (string username, string password, System.Action< bool, string > callback)
 Authenticates the user with specified username and password using the specified profile class. More...
 
virtual void Authenticate (ILocalUser user, System.Action< bool, string > callback)
 Authenticate the specified user. More...
 
virtual void LoadUsers (string[] userIDs, System.Action< IUserProfile[]> callback)
 Loads the users by Id. More...
 
virtual void ReportProgress (string achievementId, double progress, System.Action< bool > callback)
 Reports the progress of an Achievement expressed as percentage. The progress will be multiplied by 100.0 and finally rounded to int. More...
 
virtual void ReportProgress (string achievementId, int progress, System.Action< bool > callback)
 Reports the progress of an Achievement. More...
 
virtual void LoadAchievementDescriptions (System.Action< IAchievementDescription[]> callback)
 Loads the achievement descriptions. More...
 
virtual void LoadAchievements (System.Action< IAchievement[]> callback)
 Loads the achievements. More...
 
virtual void LoadAchievements< T > (System.Action< T[]> callback)
 Loads the achievements. More...
 
virtual IAchievement CreateAchievement ()
 Creates the achievement. More...
 
virtual void ReportScore (long score, string board, System.Action< bool > callback)
 Reports the score of a Leaderboard. More...
 
virtual void ReportScore (string score, string board, System.Action< bool > callback)
 Reports the score of a Leaderboard. More...
 
virtual void ReportScore (string score, string board, string username, System.Action< bool > callback)
 Reports the score of a Leaderboard. More...
 
virtual void LoadScores (string leaderboardID, System.Action< IScore[]> callback)
 Loads the scores of a Leaderboard. More...
 
virtual void LoadScores (string leaderboardID, int page, int countPerPage, System.Action< IScore[]> callback)
 Loads the scores of a Leaderboard. More...
 
void LoadScores (string leaderboardID, TimeScope timeScope, int page, int countPerPage, System.Action< IScore[]> callback)
 Loads the scores of a Leaderboard. More...
 
virtual ILeaderboard CreateLeaderboard ()
 Creates the leaderboard. More...
 
virtual void ShowAchievementsUI ()
 Shows the achievements UI. Requires achievementUIObject and eventually achievementUIFunction set in order to work. More...
 
virtual void ShowLeaderboardUI ()
 Shows the leaderboard UI. Requires leaderboardUIObject and eventually leaderboardUIFunction set in order to work. More...
 
virtual void LoadFriends (ILocalUser user, System.Action< bool > callback)
 Loads the friends of localUser. More...
 
virtual void LoadScores (ILeaderboard board, System.Action< bool > callback)
 Loads the scores of a Leaderboard. More...
 
virtual bool GetLoading (ILeaderboard board)
 Gets the loading state of a Leaderboard. More...
 
virtual void SetLocalUser (User user)
 Sets the local user. For internal use only (e.g. User.Authenticate), it's not recommended to call this method directly. More...
 
virtual void Logout (System.Action callback)
 Logout localUser. More...
 
virtual void LoadScoresByUser (string leaderboardId, User user, eLeaderboardInterval interval, int limit, System.Action< Score, int, string > callback)
 Loads the scores of a Leaderboard by user. More...
 

Static Public Member Functions

static void ResetAllAchievements (System.Action< bool > callback)
 Resets all achievements of localUser. More...
 

Properties

ILocalUser localUser [get]
 

Detailed Description

Combu Platform implementation of Unity built-in Social interfaces (ISocialPlatform).

Member Function Documentation

◆ Authenticate() [1/3]

virtual void Combu.CombuPlatform.Authenticate ( ILocalUser  user,
System.Action< bool >  callback 
)
virtual

Authenticates the user.

Parameters
userUser.
callbackCallback.

Example of usage:

CombuManager.platform.Authenticate (user, (bool success) => {
Debug.Log("Authenticate: " + success);
});

◆ Authenticate() [2/3]

virtual void Combu.CombuPlatform.Authenticate ( ILocalUser  user,
System.Action< bool, string >  callback 
)
virtual

Authenticate the specified user.

Parameters
userUser.
callbackCallback.

Example of usage:

CombuManager.platform.Authenticate (user, (bool success, string error) => {
Debug.Log("Authenticate: " + success + " -- " + error);
});

◆ Authenticate() [3/3]

virtual void Combu.CombuPlatform.Authenticate ( string  username,
string  password,
System.Action< bool, string >  callback 
)
virtual

Authenticates the user with specified username and password.

Parameters
usernameUsername.
passwordPassword.
callbackCallback.

Example of usage:

CombuManager.platform.Authenticate ("username", "password", (bool success, string error) => {
Debug.Log("Authenticate: " + success + " -- " + error);
});

◆ Authenticate< T >()

virtual void Combu.CombuPlatform.Authenticate< T > ( string  username,
string  password,
System.Action< bool, string >  callback 
)
virtual

Authenticates the user with specified username and password using the specified profile class.

Parameters
usernameUsername.
passwordPassword.
callbackCallback.
Template Parameters
TType of the returned profiles.

Example of usage:

CombuManager.platform.Authenticate<MyUserClass> ("username", "password", (bool success, string error) => {
Debug.Log("Authenticate: " + success + " -- " + error);
});
Type Constraints
T :User 
T :new() 

◆ CreateAchievement()

virtual IAchievement Combu.CombuPlatform.CreateAchievement ( )
virtual

Creates the achievement.

Returns
The achievement.

Example of usage:

IAchievement achievement = CombuManager.platform.CreateAchievement();

◆ CreateLeaderboard()

virtual ILeaderboard Combu.CombuPlatform.CreateLeaderboard ( )
virtual

Creates the leaderboard.

Returns
The leaderboard.

Example of usage:

ILeaderboard leaderboard = CombuManager.platform.CreateLeaderboard();

◆ GetLoading()

virtual bool Combu.CombuPlatform.GetLoading ( ILeaderboard  board)
virtual

Gets the loading state of a Leaderboard.

Returns
true, if loading was gotten, false otherwise.
Parameters
boardBoard.

Example of usage:

Debug.Log("LoadFriends: " + CombuManager.platform.GetLoading(myLeaderboard));

◆ LoadAchievementDescriptions()

virtual void Combu.CombuPlatform.LoadAchievementDescriptions ( System.Action< IAchievementDescription[]>  callback)
virtual

Loads the achievement descriptions.

Parameters
callbackCallback.

Example of usage:

CombuManager.platform.LoadAchievementDescriptions ((IAchievementDescription[] descriptions) => {
Debug.Log("Achievement descriptions: " + descriptions.Length);
});

◆ LoadAchievements()

virtual void Combu.CombuPlatform.LoadAchievements ( System.Action< IAchievement[]>  callback)
virtual

Loads the achievements.

Parameters
callbackCallback.

Example of usage:

CombuManager.platform.LoadAchievements ((IAchievement[] achievements) => {
Debug.Log("Achievements: " + achievements.Length);
});

◆ LoadAchievements< T >()

virtual void Combu.CombuPlatform.LoadAchievements< T > ( System.Action< T[]>  callback)
virtual

Loads the achievements.

Parameters
callbackCallback.
Template Parameters
TThe 1st type parameter.

Example of usage:

CombuManager.platform.LoadAchievements<MyAchievementClass> ((MyAchievementClass[] achievements) => {
Debug.Log("Achievements: " + achievements.Length);
});
Type Constraints
T :Achievement 
T :new() 

◆ LoadFriends()

virtual void Combu.CombuPlatform.LoadFriends ( ILocalUser  user,
System.Action< bool >  callback 
)
virtual

Loads the friends of localUser.

Parameters
userUser.
callbackCallback.

Example of usage:

CombuManager.platform.LoadFriends (CombuManager.localUser, (bool success) => {
Debug.Log("LoadFriends: " + success);
});

◆ LoadScores() [1/4]

virtual void Combu.CombuPlatform.LoadScores ( ILeaderboard  board,
System.Action< bool >  callback 
)
virtual

Loads the scores of a Leaderboard.

Parameters
boardBoard.
callbackCallback.

Example of usage:

Leaderboard myLeaderboard = CombuManager.platform.CreateLeaderboard();
myLeaderboard.id = "123";
myLeaderboard.timeScope = UnityEngine.SocialPlatforms.TimeScope.AllTime;
myLeaderboard.range = new UnityEngine.SocialPlatforms.Range(1, 10);
CombuManager.platform.LoadScores (myLeaderboard, (bool success) => {
Debug.Log("LoadScores: " + success);
});

◆ LoadScores() [2/4]

virtual void Combu.CombuPlatform.LoadScores ( string  leaderboardID,
int  page,
int  countPerPage,
System.Action< IScore[]>  callback 
)
virtual

Loads the scores of a Leaderboard.

Parameters
leaderboardIDLeaderboard I.
pagePage.
countPerPageCount per page.
callbackCallback.

Example of usage:

CombuManager.platform.LoadScores ("1234", 1, 10, (IScore[] scores) => {
Debug.Log("Scores: " + scores.Length);
});

◆ LoadScores() [3/4]

virtual void Combu.CombuPlatform.LoadScores ( string  leaderboardID,
System.Action< IScore[]>  callback 
)
virtual

Loads the scores of a Leaderboard.

Parameters
leaderboardIDLeaderboard I.
callbackCallback.

Example of usage:

CombuManager.platform.LoadScores ("1234", (IScore[] scores) => {
Debug.Log("Scores: " + scores.Length);
});

◆ LoadScores() [4/4]

void Combu.CombuPlatform.LoadScores ( string  leaderboardID,
TimeScope  timeScope,
int  page,
int  countPerPage,
System.Action< IScore[]>  callback 
)

Loads the scores of a Leaderboard.

Parameters
leaderboardIDLeaderboard identifier.
timeScopeTime scope.
pagePage.
countPerPageCount per page.
callbackCallback.

◆ LoadScoresByUser()

virtual void Combu.CombuPlatform.LoadScoresByUser ( string  leaderboardId,
User  user,
eLeaderboardInterval  interval,
int  limit,
System.Action< Score, int, string >  callback 
)
virtual

Loads the scores of a Leaderboard by user.

Parameters
leaderboardIdLeaderboard identifier.
userUser.
intervalInterval.
callbackCallback.

Example of usage:

CombuManager.platform.LoadScores ("1234", CombuManager.localUser, eLeaderboardInterval.Week, 10, (Score score, int page, string error) => {
Debug.Log("Score: " + score.rank);
});
eLeaderboardInterval
Leaderboard interval.
Definition: CombuEnums.cs:53

◆ LoadUsers()

virtual void Combu.CombuPlatform.LoadUsers ( string[]  userIDs,
System.Action< IUserProfile[]>  callback 
)
virtual

Loads the users by Id.

Parameters
userIDsUser I ds.
callbackCallback.

Example of usage:

CombuManager.platform.LoadUsers (new string[] {1234, 5678, 9012}, (IUserProfile[] users) => {
Debug.Log("Users: " + users.Length);
});

◆ Logout()

virtual void Combu.CombuPlatform.Logout ( System.Action  callback)
virtual

Logout localUser.

Parameters
callbackCallback.

Example of usage:

CombuManager.platform.Logout();

◆ ReportProgress() [1/2]

virtual void Combu.CombuPlatform.ReportProgress ( string  achievementId,
double  progress,
System.Action< bool >  callback 
)
virtual

Reports the progress of an Achievement expressed as percentage. The progress will be multiplied by 100.0 and finally rounded to int.

Parameters
achievementIDAchievement identifier.
progressProgress.
callbackCallback.

Example of usage:

CombuManager.platform.ReportProgress ("1234", 1.0, (bool success) => {
Debug.Log("ReportProgress: " + success);
});

◆ ReportProgress() [2/2]

virtual void Combu.CombuPlatform.ReportProgress ( string  achievementId,
int  progress,
System.Action< bool >  callback 
)
virtual

Reports the progress of an Achievement.

Parameters
achievementIdAchievement identifier.
progressProgress.
callbackCallback.

Example of usage:

CombuManager.platform.ReportProgress ("1234", 100, (bool success) => {
Debug.Log("ReportProgress: " + success);
});

◆ ReportScore() [1/3]

virtual void Combu.CombuPlatform.ReportScore ( long  score,
string  board,
System.Action< bool >  callback 
)
virtual

Reports the score of a Leaderboard.

Parameters
scoreScore.
boardBoard.
callbackCallback.

Example of usage:

CombuManager.platform.ReportScore (1000, "1234", (bool success) => {
Debug.Log("ReportScore: " + success);
});

◆ ReportScore() [2/3]

virtual void Combu.CombuPlatform.ReportScore ( string  score,
string  board,
string  username,
System.Action< bool >  callback 
)
virtual

Reports the score of a Leaderboard.

Parameters
scoreScore.
boardBoard.
usernameUsername.
callbackCallback.

Example of usage:

CombuManager.platform.ReportScore ("1000", "1234", "username", (bool success) => {
Debug.Log("ReportScore: " + success);
});

◆ ReportScore() [3/3]

virtual void Combu.CombuPlatform.ReportScore ( string  score,
string  board,
System.Action< bool >  callback 
)
virtual

Reports the score of a Leaderboard.

Parameters
scoreScore.
boardBoard.
callbackCallback.

Example of usage:

CombuManager.platform.ReportScore ("1000", "1234", (bool success) => {
Debug.Log("ReportScore: " + success);
});

◆ ResetAllAchievements()

static void Combu.CombuPlatform.ResetAllAchievements ( System.Action< bool >  callback)
static

Resets all achievements of localUser.

Parameters
callbackCallback.

◆ SetLocalUser()

virtual void Combu.CombuPlatform.SetLocalUser ( User  user)
virtual

Sets the local user. For internal use only (e.g. User.Authenticate), it's not recommended to call this method directly.

Parameters
userUser.

◆ ShowAchievementsUI()

virtual void Combu.CombuPlatform.ShowAchievementsUI ( )
virtual

Shows the achievements UI. Requires achievementUIObject and eventually achievementUIFunction set in order to work.

Example of usage:

CombuManager.platform.ShowAchievementsUI();

◆ ShowLeaderboardUI()

virtual void Combu.CombuPlatform.ShowLeaderboardUI ( )
virtual

Shows the leaderboard UI. Requires leaderboardUIObject and eventually leaderboardUIFunction set in order to work.

Example of usage:

CombuManager.platform.ShowAchievementsUI();