public static void TriggerEvent(string eventName, string message) { ThisEvent thisEvent = null; if (instance.eventDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.Invoke(message); } }
// event trigger with an object passed as a parameter. public static void TriggerEvent(string eventName, string variant) { ThisEvent thisEvent = null; if (Instance.eventDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.Invoke(variant); } }
// event trigger with a string passed as a parameter. public static void TriggerEvent(string eventName, EventParams eventParams) { ThisEvent thisEvent = null; if (Instance.eventParamDictionary.TryGetValue(eventName, out thisEvent)) { // finally passes the message. thisEvent.Invoke(eventParams); } }
/// <summary> /// Trigger an event with string params. /// </summary> /// <param name="eventName"> Event to trigger.</param> /// <param name="json"> String json params to pass to all the callback actions mapped to this event. </param> public static void TriggerEvent(string eventName, string json) { //print("EventManager:TriggerEvent eventName = " + eventName); ThisEvent thisEvent = null; if (Instance.eventDictionary.TryGetValue(eventName, out thisEvent)) { // Passes the params to all the callbacks waiting on this event. thisEvent.Invoke(json); } }
public void Raise(object sender, EventInfo info) => ThisEvent?.Invoke(sender, info);