Пример #1
0
        /// <summary>
        /// Progresses an achievement.
        /// The target value is what the 100% marker is, the actual value is what the actual value was achieved.<para/>
        /// For example, say the achievement is to gain 1000 points (target), and the player achieved 750 points (actual).<para/>
        /// Then the achievement would be 75% (750/1000) complete.
        /// </summary>
        public void ProgressAchievement(int id, float target, float actual)
        {
            Achievement achievement = GetAchievement(id);

            achievement.Progress(target, actual);
            NotifyIfUnlocked(achievement);
            AchievementDatabase.SaveAchievementsToFile(achievements);
        }
Пример #2
0
        /// <summary>
        /// Instantly unlocks an achievement.
        /// </summary>
        public void UnlockAchievement(int id)
        {
            Achievement achievement = GetAchievement(id);

            achievement.Unlock();
            NotifyIfUnlocked(achievement);
            AchievementDatabase.SaveAchievementsToFile(achievements);
        }