/// <summary> /// Method used to get a defined number of users around the current user, based on a defined stat. /// </summary> /// <param name="property">Property to define the leaderboard.</param> /// <param name="maxResults">Maximum number of players to return.</param> /// <param name="OnLeaberboardLoaded">Callback when the leaderboard is loaded.</param> public void GetLeaderboardAroundMe(string property, int maxResults, ProjectDelegates.PlayFabLeaderboardCallback OnLeaberboardLoaded) { OnLeaderboardLoadedCallback = OnLeaberboardLoaded; GetLeaderboardAroundCurrentUserRequest request = new GetLeaderboardAroundCurrentUserRequest(); request.StatisticName = property; request.MaxResultsCount = maxResults; PlayFabClientAPI.GetLeaderboardAroundCurrentUser(request, OnGetLeaderboardAroundMeResult, OnGetLeaderboardError); }
/// <summary> /// Method used to get a defined number of users starting from a defined position, based on a defined stat. /// </summary> /// /// <param name="property">Property to define the leaderboard.</param> /// <param name="maxResults">Maximum number of players to return.</param> /// /// <param name="startPosition">Position to start getting the leaderboard.</param> /// <param name="OnLeaberboardLoaded">Callback when the leaderboard is loaded.</param> public void GetLeaderboardFromPosition(string property, int maxResults, int startPosition, ProjectDelegates.PlayFabLeaderboardCallback OnLeaberboardLoaded) { OnLeaderboardLoadedCallback = OnLeaberboardLoaded; GetLeaderboardRequest request = new GetLeaderboardRequest(); request.StatisticName = property; request.MaxResultsCount = maxResults; request.StartPosition = startPosition; PlayFabClientAPI.GetLeaderboard(request, OnGetLeaderboardFromPositionResult, OnGetLeaderboardError); }