|
@@ -241,6 +241,84 @@ namespace KairoEngine.Core
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
+ #region String_float_Event
|
|
|
+
|
|
|
+ public static Dictionary<string, System.Action<string, float>> stringFloatList = new Dictionary<string, System.Action<string, float>>();
|
|
|
+
|
|
|
+ public static void StartListening(string title, System.Action<string, float> listener)
|
|
|
+ {
|
|
|
+ System.Action<string, float> action = null;
|
|
|
+ if (stringFloatList.TryGetValue(title, out action))
|
|
|
+ {
|
|
|
+ action += listener;
|
|
|
+ stringFloatList[title] = action;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ action += listener;
|
|
|
+ stringFloatList.Add(title, action);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void StopListening(string title, System.Action<string, float> listener)
|
|
|
+ {
|
|
|
+ System.Action<string, float> action = null;
|
|
|
+ if (stringFloatList.TryGetValue(title, out action))
|
|
|
+ {
|
|
|
+ action -= listener;
|
|
|
+ stringFloatList[title] = action;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void Trigger(string title, string text, float value)
|
|
|
+ {
|
|
|
+ System.Action<string, float> action = null;
|
|
|
+ if (stringFloatList.TryGetValue(title, out action))
|
|
|
+ {
|
|
|
+ if(action != null) action(text, value);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region String_string_Event
|
|
|
+
|
|
|
+ public static Dictionary<string, System.Action<string, string>> stringStringList = new Dictionary<string, System.Action<string, string>>();
|
|
|
+
|
|
|
+ public static void StartListening(string title, System.Action<string, string> listener)
|
|
|
+ {
|
|
|
+ System.Action<string, string> action = null;
|
|
|
+ if (stringStringList.TryGetValue(title, out action))
|
|
|
+ {
|
|
|
+ action += listener;
|
|
|
+ stringStringList[title] = action;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ action += listener;
|
|
|
+ stringStringList.Add(title, action);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void StopListening(string title, System.Action<string, string> listener)
|
|
|
+ {
|
|
|
+ System.Action<string, string> action = null;
|
|
|
+ if (stringStringList.TryGetValue(title, out action))
|
|
|
+ {
|
|
|
+ action -= listener;
|
|
|
+ stringStringList[title] = action;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void Trigger(string title, string text, string value)
|
|
|
+ {
|
|
|
+ System.Action<string, string> action = null;
|
|
|
+ if (stringStringList.TryGetValue(title, out action))
|
|
|
+ {
|
|
|
+ if(action != null) action(text, value);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
#region ScriptableObject_Event
|
|
|
|
|
|
public static Dictionary<string, System.Action<ScriptableObject>> list6 = new Dictionary<string, System.Action<ScriptableObject>>();
|