ActivityMessage.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. using Sirenix.OdinInspector;
  6. namespace KairoEngine.UI.ActivityMessages
  7. {
  8. [System.Serializable]
  9. public class ActivityMessage
  10. {
  11. [FoldoutGroup("@GetTitle()")] public string text;
  12. [FoldoutGroup("@GetTitle()")] public string id;
  13. [FoldoutGroup("@GetTitle()")] public string group;
  14. [FoldoutGroup("@GetTitle()")] public string prefab;
  15. [FoldoutGroup("@GetTitle()")] public Sprite icon;
  16. [FoldoutGroup("@GetTitle()")] public float time;
  17. [FoldoutGroup("@GetTitle()")] public bool sticky;
  18. [FoldoutGroup("@GetTitle()")] public bool hideOnClick;
  19. [FoldoutGroup("@GetTitle()")] public Action action;
  20. [FoldoutGroup("@GetTitle()")] public string tooltipHeader;
  21. [FoldoutGroup("@GetTitle()")] public string tooltipBody;
  22. [FoldoutGroup("@GetTitle()")] public string tooltipType;
  23. public ActivityMessage(string text, string id = "", string group = "", string prefab = "", Sprite icon = null, float time = 5f, bool sticky = false,
  24. bool hideOnClick = true, Action action = null, string tooltipHeader = "", string tooltipBody = "", string tooltipType = "")
  25. {
  26. this.text = text;
  27. this.id = id;
  28. this.group = group;
  29. this.prefab = prefab;
  30. this.icon = icon;
  31. this.time = time;
  32. this.sticky = sticky;
  33. this.hideOnClick = hideOnClick;
  34. this.action = action;
  35. this.tooltipHeader = tooltipHeader;
  36. this.tooltipBody = tooltipBody;
  37. this.tooltipType = tooltipType;
  38. }
  39. public string GetTitle()
  40. {
  41. if(id != "") return id;
  42. else return text;
  43. }
  44. }
  45. }