ActivityMessage.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. public ActivityMessage(string text, string id = "", string group = "", string prefab = "", Sprite icon = null, float time = 5f, bool sticky = false,
  23. bool hideOnClick = true, Action action = null, string tooltipHeader = "", string tooltipBody = "")
  24. {
  25. this.text = text;
  26. this.id = id;
  27. this.group = group;
  28. this.prefab = prefab;
  29. this.icon = icon;
  30. this.time = time;
  31. this.sticky = sticky;
  32. this.hideOnClick = hideOnClick;
  33. this.action = action;
  34. this.tooltipHeader = tooltipHeader;
  35. this.tooltipBody = tooltipBody;
  36. }
  37. public string GetTitle()
  38. {
  39. if(id != "") return id;
  40. else return text;
  41. }
  42. }
  43. }