ActivityMessageEvents.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace KairoEngine.Core
  5. {
  6. public class ActivityMessageEvents
  7. {
  8. #region SimpleMessage
  9. public static event System.Action<string> OnActivityMessage;
  10. public static void Send(string text)
  11. {
  12. if(OnActivityMessage != null)
  13. {
  14. OnActivityMessage(text);
  15. }
  16. }
  17. #endregion
  18. #region TimedMessage
  19. public static event System.Action<string, float> OnTimedActivityMessage;
  20. public static void Send(string text, float time)
  21. {
  22. if(OnTimedActivityMessage != null)
  23. {
  24. OnTimedActivityMessage(text, time);
  25. }
  26. }
  27. #endregion
  28. #region StickyMessage
  29. public static event System.Action<string, bool> OnStickyActivityMessage;
  30. public static void Send(string text, bool sticky)
  31. {
  32. if(OnStickyActivityMessage != null)
  33. {
  34. OnStickyActivityMessage(text, sticky);
  35. }
  36. }
  37. #endregion
  38. #region UpdateMessage
  39. public static event System.Action<string, string, float, bool> OnUpdateActivityMessage;
  40. public static void Update(string oldText, string newText, float time, bool sticky)
  41. {
  42. if(OnUpdateActivityMessage != null)
  43. {
  44. OnUpdateActivityMessage(oldText, newText, time, sticky);
  45. }
  46. }
  47. #endregion
  48. #region RemoveMessage
  49. public static event System.Action<string> OnRemoveActivityMessage;
  50. public static void Remove(string text)
  51. {
  52. if(OnRemoveActivityMessage != null)
  53. {
  54. OnRemoveActivityMessage(text);
  55. }
  56. }
  57. #endregion
  58. }
  59. }