DefaultEncyclopediaCategory.cs 804 B

12345678910111213141516171819202122
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using Sirenix.OdinInspector;
  5. public class DefaultEncyclopediaCategory : EncyclopediaCategory
  6. {
  7. public List<DefaultEncyclopediaCategoryArticle> articles = new List<DefaultEncyclopediaCategoryArticle>();
  8. [System.Serializable]
  9. public class DefaultEncyclopediaCategoryArticle
  10. {
  11. [HorizontalGroup("Line", 0.015f), HideLabel] public bool unlocked = true;
  12. [HorizontalGroup("Line", 0.985f), HideLabel] public DefaultEncyclopediaArticle article;
  13. }
  14. public override List<EncyclopediaArticle> GetArticles()
  15. {
  16. var data = new List<EncyclopediaArticle>();
  17. foreach (var article in articles) data.Add(((IEncyclopediaArticle)article).GetArticle());
  18. return data;
  19. }
  20. }