Stay organized with collections
Save and categorize content based on your preferences.
GooglePlayGames.PlayGamesLeaderboard
Represents a Google Play Games leaderboard.
Summary
The class provides a way to configure and store data for a specific leaderboard. Implements Unity's generic ILeaderboard
interface.
Inheritance
Inherits from: ILeaderboard
Properties
|
ScoreCount
|
int
Gets the number of scores currently loaded.
|
id
|
string
Gets or sets the leaderboard ID.
|
loading
|
bool
Gets a value indicating whether the leaderboard scores are currently loading.
|
localUserScore
|
IScore
Gets the local user's score on this leaderboard.
|
maxRange
|
uint
Gets the approximate number of total scores in the leaderboard.
|
range
|
Range
Gets or sets the rank range for the scores to be loaded.
|
scores
|
IScore[]
Gets the array of loaded scores.
|
timeScope
|
TimeScope
Gets or sets the time scope for the scores to be loaded.
|
title
|
string
Gets the title of the leaderboard.
|
userScope
|
UserScope
Gets or sets the user scope for the scores to be loaded.
|
Public functions
|
LoadScores(System.Action< bool > callback)
|
void
Initiates the loading of scores from the Google Play Games platform.
|
SetUserFilter(string[] userIDs)
|
void
Sets a filter to load scores only for a specific set of users.
|
Properties
ScoreCount
int ScoreCount
Gets the number of scores currently loaded.
The score count.
id
string id
Gets or sets the leaderboard ID.
The leaderboard ID.
loading
bool loading
Gets a value indicating whether the leaderboard scores are currently loading.
true
if loading; otherwise, false
.
localUserScore
IScore localUserScore
Gets the local user's score on this leaderboard.
The local user's score.
maxRange
uint maxRange
Gets the approximate number of total scores in the leaderboard.
The maximum range of scores.
range
Range range
Gets or sets the rank range for the scores to be loaded.
The rank range.
scores
IScore[] scores
Gets the array of loaded scores.
The scores.
timeScope
TimeScope timeScope
Gets or sets the time scope for the scores to be loaded.
The time scope.
title
string title
Gets the title of the leaderboard.
The title.
userScope
UserScope userScope
Gets or sets the user scope for the scores to be loaded.
The user scope.
Public functions
LoadScores
void LoadScores(
System.Action< bool > callback
)
Initiates the loading of scores from the Google Play Games platform.
Details |
Parameters |
callback
|
A callback that will be invoked with a boolean indicating the success of the operation.
|
|
PlayGamesLeaderboard
PlayGamesLeaderboard(
string id
)
SetUserFilter
void SetUserFilter(
string[] userIDs
)
Sets a filter to load scores only for a specific set of users.
Details |
Parameters |
userIDs
|
The array of user IDs to filter by.
|
|
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-07-08 UTC.
[null,null,["Last updated 2025-07-08 UTC."],[],[],null,["# GooglePlayGames.PlayGamesLeaderboard Class Reference\n\nGooglePlayGames.PlayGamesLeaderboard\n====================================\n\nRepresents a Google Play Games leaderboard.\n\nSummary\n-------\n\nThe class provides a way to configure and store data for a specific leaderboard. Implements Unity's generic `ILeaderboard` interface.\n\n### Inheritance\n\nInherits from: ILeaderboard\n\n| ### Constructors and Destructors ||\n|---|---|\n| [PlayGamesLeaderboard](#class_google_play_games_1_1_play_games_leaderboard_1a53c739109490d79593d3570fa64325b8)`(string id)` Initializes a new instance of the [PlayGamesLeaderboard](/games/services/unity/v2/api/class/google-play-games/play-games-leaderboard#class_google_play_games_1_1_play_games_leaderboard) class. ||\n\n| ### Properties ||\n|----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|\n| [ScoreCount](#class_google_play_games_1_1_play_games_leaderboard_1ad64d9c13ce47230bb948baf56c2d2f74) | `int` Gets the number of scores currently loaded. |\n| [id](#class_google_play_games_1_1_play_games_leaderboard_1a60647b76c5b1512e9e5508cd0f585474) | `string` Gets or sets the leaderboard ID. |\n| [loading](#class_google_play_games_1_1_play_games_leaderboard_1a70122280028fd8ef12996d7255bc5173) | `bool` Gets a value indicating whether the leaderboard scores are currently loading. |\n| [localUserScore](#class_google_play_games_1_1_play_games_leaderboard_1a598ac74d7a1c60c9ab42a8eace6a36f4) | `IScore` Gets the local user's score on this leaderboard. |\n| [maxRange](#class_google_play_games_1_1_play_games_leaderboard_1a1c1eb6071f7032bf169f4d192200e72a) | `uint` Gets the approximate number of total scores in the leaderboard. |\n| [range](#class_google_play_games_1_1_play_games_leaderboard_1af14eb81a2dafc0b8f5e81641e2f33637) | `Range` Gets or sets the rank range for the scores to be loaded. |\n| [scores](#class_google_play_games_1_1_play_games_leaderboard_1a880e8d9618d05ea437c0fee26a882423) | `IScore[]` Gets the array of loaded scores. |\n| [timeScope](#class_google_play_games_1_1_play_games_leaderboard_1abe5ff4265350e20fd55551cf66ebf4b7) | `TimeScope` Gets or sets the time scope for the scores to be loaded. |\n| [title](#class_google_play_games_1_1_play_games_leaderboard_1a4c9c7aaae26fd69b97bb09a7625e6eaa) | `string` Gets the title of the leaderboard. |\n| [userScope](#class_google_play_games_1_1_play_games_leaderboard_1aa7f3c830cba20836ad8e300fc93552ed) | `UserScope` Gets or sets the user scope for the scores to be loaded. |\n\n| ### Public functions ||\n|----------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------|\n| [LoadScores](#class_google_play_games_1_1_play_games_leaderboard_1abb667a61a32de4ce314a41130b92786f)`(System.Action\u003c bool \u003e callback)` | `void` Initiates the loading of scores from the Google Play Games platform. |\n| [SetUserFilter](#class_google_play_games_1_1_play_games_leaderboard_1aa85c25944650dda81b203c38c953b8ca)`(string[] userIDs)` | `void` Sets a filter to load scores only for a specific set of users. |\n\nProperties\n----------\n\n### ScoreCount\n\n```c#\nint ScoreCount\n``` \nGets the number of scores currently loaded.\n\nThe score count. \n\n### id\n\n```c#\nstring id\n``` \nGets or sets the leaderboard ID.\n\nThe leaderboard ID. \n\n### loading\n\n```c#\nbool loading\n``` \nGets a value indicating whether the leaderboard scores are currently loading.\n\n`true` if loading; otherwise, `false`. \n\n### localUserScore\n\n```c#\nIScore localUserScore\n``` \nGets the local user's score on this leaderboard.\n\nThe local user's score. \n\n### maxRange\n\n```c#\nuint maxRange\n``` \nGets the approximate number of total scores in the leaderboard.\n\nThe maximum range of scores. \n\n### range\n\n```c#\nRange range\n``` \nGets or sets the rank range for the scores to be loaded.\n\nThe rank range. \n\n### scores\n\n```c#\nIScore[] scores\n``` \nGets the array of loaded scores.\n\nThe scores. \n\n### timeScope\n\n```c#\nTimeScope timeScope\n``` \nGets or sets the time scope for the scores to be loaded.\n\nThe time scope. \n\n### title\n\n```c#\nstring title\n``` \nGets the title of the leaderboard.\n\nThe title. \n\n### userScope\n\n```c#\nUserScope userScope\n``` \nGets or sets the user scope for the scores to be loaded.\n\nThe user scope.\n\nPublic functions\n----------------\n\n### LoadScores\n\n```c#\nvoid LoadScores(\n System.Action\u003c bool \u003e callback\n)\n``` \nInitiates the loading of scores from the Google Play Games platform.\n\n\u003cbr /\u003e\n\n| Details ||\n|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |------------|-----------------------------------------------------------------------------------------| | `callback` | A callback that will be invoked with a boolean indicating the success of the operation. | |\n\n### PlayGamesLeaderboard\n\n```c#\n PlayGamesLeaderboard(\n string id\n)\n``` \nInitializes a new instance of the [PlayGamesLeaderboard](/games/services/unity/v2/api/class/google-play-games/play-games-leaderboard#class_google_play_games_1_1_play_games_leaderboard) class.\n\n\u003cbr /\u003e\n\n| Details ||\n|------------|---------------------------------------------------------------|\n| Parameters | |------|---------------------| | `id` | The leaderboard ID. | |\n\n### SetUserFilter\n\n```c#\nvoid SetUserFilter(\n string[] userIDs\n)\n``` \nSets a filter to load scores only for a specific set of users.\n\n\u003cbr /\u003e\n\n| Details ||\n|------------|---------------------------------------------------------------------------------------------------------|\n| Parameters | |-----------|-------------------------------------| | `userIDs` | The array of user IDs to filter by. | |"]]