ActivityMessage.cs 1.4 KB

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