public void OnEventRaised <T0, T1, T2, T3>(GameEventBase e, T0 arg0, T1 arg1, T2 arg2, T3 arg3) { for (int i = 0; i < eventResponsePairs.Length; i++) { EventResponsePair eventResponsePair = eventResponsePairs[i]; if (e.Equals(eventResponsePair.Event)) { eventResponsePair.LogToConsoleIfEnabled(this); eventResponsePair.Invoke(arg0, arg1, arg2, arg3); } } }
/// <summary> /// Invokes listeners if their event's name matches the name of the passed argument. /// </summary> /// <param name="e">Target event.</param> public void OnEventRaised(GameEventBase e) { for (int i = 0; i < eventResponsePairs.Length; i++) { EventResponsePair eventResponsePair = eventResponsePairs[i]; if (e.Equals(eventResponsePair.Event)) { eventResponsePair.LogToConsoleIfEnabled(this); eventResponsePair.Invoke(); } } }