Example #1
0
    public void addAchievement(achievementTyp typ)
    {
        load();
        bool playAnimation = false;

        foreach (achievementConfig ac in achievements)
        {
            if (ac.typ == typ)
            {
                ac.achievementCnt++;
                ac.save();

                foreach (achievementStage aStage in ac.achievementStages)
                {
                    if (ac.achievementCnt == aStage.achievementTarget)
                    {
                        playAnimation = true;
                    }
                }
                if (playAnimation == true)
                {
                    showAchievementAnimation(ac);
                }

                activateGameObjects();
                countAndShowAchieventProgesss();
            }
        }
    }
Example #2
0
    public void setAchievementCounter(achievementTyp typ, int newAchievementCounter)
    {
        load();
        bool playAnimation = false;

        foreach (achievementConfig ac in achievements)
        {
            if (ac.typ == typ)
            {
                //only accept new counter values, if bigger than previous reached ones.
                if (newAchievementCounter > ac.achievementCnt)
                {
                    ac.achievementCnt = newAchievementCounter;

                    foreach (achievementStage aStage in ac.achievementStages)
                    {
                        if (ac.achievementCnt == aStage.achievementTarget)
                        {
                            playAnimation = true;
                        }
                    }
                    if (playAnimation == true)
                    {
                        showAchievementAnimation(ac);
                    }

                    activateGameObjects();
                    countAndShowAchieventProgesss();
                }

                ac.save();
            }
        }
    }
Example #3
0
    public void addAchievement(achievementTyp typ)
    {
        load();
        foreach (achievementConfig ac in achievements)
        {
            if (ac.typ == typ)
            {
                ac.achievementCnt++;
                ac.save();

                if (ac.achievementCnt == 1)
                {
                    showAchievementAnimation(ac);
                }

                activatGameObjects();
                countAndShowAchieventProgesss();
            }
        }
    }