using System.Collections; using System.Collections.Generic; using UnityEngine; using KairoEngine.UI.Encyclopedia; using Sirenix.OdinInspector; namespace KairoEngine.Achievements { public class AchievementsEncyclopediaCategory : EncyclopediaCategory { public AchievementsController achievementsController; private List data = new List(); private void Start() { if(achievementsController == null) achievementsController = FindObjectOfType(); if(achievementsController == null) Debug.LogError("Missing Achievements Controller", this.gameObject); } public override List GetArticles() { UpdateArticles(); return data; } public override void UpdateArticles() { data = new List(); if(achievementsController == null) return; foreach (AchievementStatus item in achievementsController.achievementsStatus) { var article = item.achievement.GetArticle(); article.id = id + "_" + article.id; article.unlocked = item.unlocked; data.Add(article); } } } }