|
@@ -360,6 +360,45 @@ namespace KairoEngine.Core
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
+ #region Vector3_Event
|
|
|
+
|
|
|
+ public static Dictionary<string, System.Action<Vector3>> listVector3 = new Dictionary<string, System.Action<Vector3>>();
|
|
|
+
|
|
|
+ public static void StartListening(string title, System.Action<Vector3> listener)
|
|
|
+ {
|
|
|
+ System.Action<Vector3> action = null;
|
|
|
+ if (listVector3.TryGetValue(title, out action))
|
|
|
+ {
|
|
|
+ action += listener;
|
|
|
+ listVector3[title] = action;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ action += listener;
|
|
|
+ listVector3.Add(title, action);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void StopListening(string title, System.Action<Vector3> listener)
|
|
|
+ {
|
|
|
+ System.Action<Vector3> action = null;
|
|
|
+ if (listVector3.TryGetValue(title, out action))
|
|
|
+ {
|
|
|
+ action -= listener;
|
|
|
+ listVector3[title] = action;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void Trigger(string title, Vector3 value)
|
|
|
+ {
|
|
|
+ System.Action<Vector3> action = null;
|
|
|
+ if (listVector3.TryGetValue(title, out action))
|
|
|
+ {
|
|
|
+ if(action != null) action(value);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
#region String_Vector3_Event
|
|
|
|
|
|
public static Dictionary<string, System.Action<string, Vector3>> listStringVector3 = new Dictionary<string, System.Action<string, Vector3>>();
|