Exemplo n.º 1
0
    public static void AddNewScoreTest3(int score)
    {
        completedTest3 = true;
        scoreTest3     = score;
        if (score > highScoreTest3)
        {
            highScoreTest3 = score;
        }
        if (currUser != "GUEST")
        {
            PlayGamesController.PostToLeaderboardTest3((long)score);
        }

        for (int i = 1; i <= 10; ++i)
        {
            string keyStr = "test3Score" + i;
            if (!PlayerPrefs.HasKey(keyStr))
            {
                PlayerPrefs.SetInt(keyStr, score);
                return;
            }
        }

        for (int i = 1; i < 10; ++i)
        {
            string keyStr1 = "test3Score" + i;
            string keyStr2 = "test3Score" + (i + 1);
            PlayerPrefs.SetInt(keyStr1, PlayerPrefs.GetInt(keyStr2));
        }
        PlayerPrefs.SetInt("test3Score10", score);
    }