Beispiel #1
0
    public void StoreToken(LeaderboardToken token)
    {
        if (token.isInvalid)
        {
            return;
        }

        print("New Record, level " + token.levelIndex
              + " completed in: " + token.timeInSecs.ToString());
        PlayerPrefs.SetFloat(token.key, token.timeInSecs);
    }
Beispiel #2
0
    public LeaderboardToken GetToken(int levelIndex)
    {
        float current = GetRecordedTime(levelIndex);

        if (current == noScoreRecorded)
        {
            return(LeaderboardToken.Invalid(levelIndex));
        }

        return(LeaderboardToken.WithData(levelIndex, current));
    }