GetPlayerScore

Description

Get the highest score from leaderboard for the current user.

Declaration

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

Parameters

NameDescription

leaderboardName

The name from Settings Window of the Leaderboard.

completeMethod

Method to call after score is read.

Example

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

    private void ScoreLoaded(long score)
    {
        //read the score from here
        Debug.Log("Score: " + score);
    }
}

Last updated