123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- namespace KairoEngine.Core
- {
- public class ActivityMessageEvents
- {
- #region SimpleMessage
- public static event System.Action<string> OnActivityMessage;
- public static void Send(string text)
- {
- if(OnActivityMessage != null)
- {
- OnActivityMessage(text);
- }
- }
- #endregion
- #region TimedMessage
- public static event System.Action<string, float> OnTimedActivityMessage;
- public static void Send(string text, float time)
- {
- if(OnTimedActivityMessage != null)
- {
- OnTimedActivityMessage(text, time);
- }
- }
- #endregion
- #region StickyMessage
- public static event System.Action<string, bool> OnStickyActivityMessage;
- public static void Send(string text, bool sticky)
- {
- if(OnStickyActivityMessage != null)
- {
- OnStickyActivityMessage(text, sticky);
- }
- }
- #endregion
- #region FullMessage
- public static event System.Action<string, string, string, string, Sprite, float, bool, bool, Action, string, string, string> OnFullMessage;
- public static void Send(string text, string id, string group, string prefab, Sprite icon, float time, bool sticky, bool hideOnClick,
- Action action, string tooltipHeader = "", string tooltipBody = "", string tooltipType = "")
- {
- if(OnFullMessage != null)
- {
- OnFullMessage(text, id, group, prefab, icon, time, sticky, hideOnClick, action, tooltipHeader, tooltipBody, tooltipType);
- }
- }
- #endregion
- #region UpdateMessage
- public static event System.Action<string, string, Sprite, float, bool, bool, Action, string, string, string> OnUpdateActivityMessage;
- public static void Update(string id, string newText, Sprite newIcon, float newTime, bool sticky, bool hideOnClick,
- Action newAction, string tooltipHeader = "", string tooltipBody = "", string tooltipType = "")
- {
- if(OnUpdateActivityMessage != null)
- {
- OnUpdateActivityMessage(id, newText, newIcon, newTime, sticky, hideOnClick, newAction, tooltipHeader, tooltipBody, tooltipType);
- }
- }
- #endregion
- #region RemoveMessage
- public static event System.Action<string> OnRemoveActivityMessage;
- public static void Remove(string text)
- {
- if(OnRemoveActivityMessage != null)
- {
- OnRemoveActivityMessage(text);
- }
- }
- #endregion
- }
- }
|