DefaultEncyclopediaArticle.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using Sirenix.OdinInspector;
  5. [CreateAssetMenu(fileName = "Encyclopedia Article", menuName = "KairoEngine/Encyclopedia Article"), HideMonoScript]
  6. public class DefaultEncyclopediaArticle : ScriptableObject, IEncyclopediaArticle
  7. {
  8. public string title = "Example Article Title";
  9. public Sprite icon;
  10. public Sprite image;
  11. public string author;
  12. public string date;
  13. public string description;
  14. [HideLabel, TextArea()] public string text;
  15. public EncyclopediaArticle GetArticle()
  16. {
  17. var article = new EncyclopediaArticle();
  18. article.id = title;
  19. article.title = title;
  20. article.description = description;
  21. article.icon = icon;
  22. article.content.Add("title", title);
  23. article.content.Add("author", author);
  24. article.content.Add("date", date);
  25. article.content.Add("text", text);
  26. article.images.Add("icon", icon);
  27. article.images.Add("image", image);
  28. //Debug.Log($"Created article with {article.content.Keys.Count} content keys");
  29. return article;
  30. }
  31. }