/// <summary> /// Triggers the event. /// </summary> /// <param name="eventName">Event name.</param> /// <param name="args">Arguments.</param> static public void Trigger(eEvent eventName, params object[] args) { if (eventDictionary[(int)eventName] != null) { try { eventDictionary[(int)eventName](args); } catch { } } }
public static void StopListening(eEvent eventName, UnityAction <BaseEvent> listener) { if (eventManager == null) { return; } UnityEventBase thisEvent = null; if (instance.eventDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.RemoveListener(listener); } }
public static void StartListening(eEvent eventName, UnityAction <BaseEvent> listener) { UnityEventBase thisEvent = null; if (instance.eventDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.AddListener(listener); } else { thisEvent = new UnityEventBase(); thisEvent.AddListener(listener); instance.eventDictionary.Add(eventName, thisEvent); } }
public void ShowDialog() { eExitResult = NavigationButtons.Navigation.eEvent.NOTHING; LastStartupDialog_TYPE = ChildDialog.GetType().ToString(); if (!bDoModal) { ChildDialog.StartPosition = FormStartPosition.CenterScreen; ChildDialog.TopMost = true; ChildDialog.Visible = true; ChildDialog.Show(); while (eExitResult == NavigationButtons.Navigation.eEvent.NOTHING) { Application.DoEvents(); } if (ChildDialog.IsAccessible) { ChildDialog.Close(); } } else { ChildDialog.ShowDialog(); } }
/// <summary> /// Triggers the event. /// </summary> /// <param name="eventName">Event name.</param> static public void Trigger(eEvent eventName) { Trigger(eventName, null); }
/// <summary> /// Stops the listening an Event. /// Its best to be called OnDisabled /// </summary> /// <param name="eventName">Event name.</param> /// <param name="listener">Listener.</param> static public void Remove(eEvent eventName, EventArguments listener) { eventDictionary[(int)eventName] -= listener; }
/// <summary> /// Starts the listening an event. /// Its best to be called OnEnabled /// </summary> /// <param name="eventName">Event name.</param> /// <param name="listener">Listener.</param> static public void Listen(eEvent eventName, EventArguments listener) { eventDictionary[(int)eventName] += listener; }
internal void After(eEvent evt, object sender, EventArgs e) { }
internal void Before(eEvent evt, object sender, EventArgs e) { }