/// <summary> /// Add progress to selected achievement /// </summary> /// <param name="achievement"></param> /// <param name="count"></param> public void AddProgressAchievement(ProgressAchievement achievement, byte count) { if (!achievement.GetState()) { achievement.AddProgress(count); achievement.Check(); Notify(prefabAchievement, achievement.GetID(), true); if (achievement.Check()) { Notify(prefabAchievement, achievement.GetID(), false); Output(achievement_header, achievement_icon, achievement); } } }
/// <summary> /// Unlock selected achievement /// </summary> /// <param name="achievement"></param> private void UnlockAchievement(Achievement achievement, Text outputHeader, Image outputIcon) { if (!achievement.GetState()) { if (achievement is ProgressAchievement) { ProgressAchievement progressAchievement = (ProgressAchievement)achievement; progressAchievement.AddProgress(100); } achievement.SetState(true); Notify(prefabAchievement, achievement.GetID(), false); Output(outputHeader, outputIcon, achievement); } }