Ejemplo n.º 1
0
    public void resetProgress()
    {
        PlayerPrefs.DeleteAll();
        levelUnlocked_level_1 = 0;
        levelUnlocked_level_2 = 0;

        SocialEvents.OnCompetitionHiscore(1, 0, false);
        userData.resetProgress();
        Social.Instance.hiscores.Reset();
    }
    private List <AreaSet> Randomize(List <AreaSet> toRandom)
    {
        SocialEvents.OnCompetitionHiscore(1, 0, false);

        //if (!Data.Instance.isArcade && Data.Instance.playMode == Data.PlayModes.COMPETITION || Data.Instance.playMode == Data.PlayModes.GHOSTMODE)
        // Random.seed = Social.Instance.hiscores.GetMyScore();
        for (int i = 0; i < toRandom.Count; i++)
        {
            AreaSet temp        = toRandom[i];
            int     randomIndex = Random.Range(i, toRandom.Count);
            toRandom[i]           = toRandom[randomIndex];
            toRandom[randomIndex] = temp;
            temp.Restart();
        }
        return(toRandom);
    }
Ejemplo n.º 3
0
    void checkToSaveHiscore(int competitionID, float score)
    {
        Debug.Log("Check to save HISCORE: competitionID: " + competitionID + " oldScore: " + levels[competitionID - 1].myScore + " new score: " + score);
        if (levels[competitionID - 1].myScore >= score)
        {
            return;
        }

        bool isNew = false;

        if (levels[competitionID - 1].myScore == 0)
        {
            isNew = true;
        }

        levels[competitionID - 1].myScore = (int)score;

        PlayerPrefs.SetInt("scoreLevel_" + competitionID, (int)score);
        SocialEvents.OnCompetitionHiscore(competitionID, (int)score, isNew);
    }