using System.Collections; using System.Collections.Generic; using UnityEngine; using Sirenix.OdinInspector; namespace KairoEngine.UI.Encyclopedia { public class DefaultEncyclopediaCategory : EncyclopediaCategory { public List articles = new List(); private List data = new List(); [System.Serializable] public class DefaultEncyclopediaCategoryArticle { [HorizontalGroup("Line", 0.015f), HideLabel] public bool unlocked = true; [HorizontalGroup("Line", 0.985f), HideLabel] public DefaultEncyclopediaArticle article; } public override List GetArticles() { if(data.Count == 0) UpdateArticles(); return data; } public override void UpdateArticles() { data = new List(); foreach (DefaultEncyclopediaCategoryArticle item in articles) { var article = item.article.GetArticle(); article.id = id + "_" + article.id; article.unlocked = item.unlocked; data.Add(article); } } } }