GetPlayerRank

Description

Get rank from leaderboard for the current user.

Declaration

public static void GetPlayerRank(LeaderboardNames leaderboardName, UnityAction<long> completeMethod)

Parameters

NameDescription

leaderboardName

The name from Settings Window of the Leaderboard.

completeMethod

Method to call after rank is read.

Example

public class Test : MonoBehaviour
{
    public void GetPlayerRank()
    {
        Gley.GameServices.API.GetPlayerRank(LeaderboardNames.HighestJumpers, RankLoaded);
    }

    private void RankLoaded(long rank)
    {
        //read the rank from here
        Debug.Log("Rank: " + rank);
    }
}

Last updated