Ejemplo n.º 1
0
    public static void TriggerEvent(string eventName, string message)
    {
        ThisEvent thisEvent = null;

        if (instance.eventDictionary.TryGetValue(eventName, out thisEvent))
        {
            thisEvent.Invoke(message);
        }
    }
Ejemplo n.º 2
0
    // 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);
        }
    }
Ejemplo n.º 3
0
    // 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);
        }
    }
Ejemplo n.º 4
0
    /// <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);
        }
    }
Ejemplo n.º 5
0
 public void Raise(object sender, EventInfo info) => ThisEvent?.Invoke(sender, info);