Use a Progression System In-Game

After setting up progression with levels and awards in the console, it's time to actually use this in your game.

At an appropriate time in your game you call the submit XP endpoint like so

int scoreToSubmit = 100;

LootLockerSDKManager.SubmitXp(scoreToSubmit , (response) =>
{
    if (response.success)
    {
        Debug.Log("Successful");
    }
    else
    {
        Debug.Log("Error: " + response.Error);
    }
});

To read more about the response of the call to the endpoint, please check out the documentation in our reference section for Submit XP

It's also possible to award XP as part of a trigger

If you want to know how much XP a player currently have, you can use the Get Player Info endpoint to do so.

LootLockerSDKManager.GetXpAndLevel((response) =>
{
    if (response.success)
    {
        Debug.Log("Successful");
    }
    else
    {
        Debug.Log("Error: " + response.Error);
    }
});

To learn more about the endpoint you can check out our reference documentation on getting player info

Last updated