void PostNotification(NotificationsManager.EVENT_TYPE EType, int Param) { //Notify all listeners for (int i = 0; i < Listeners.Count; i++) { //Call delegate like function Listeners[i](EType, Param); } }
//Function prototype matches delegate public void OnEventCall(NotificationsManager.EVENT_TYPE EType, int Param) { Debug.Log("Event Called"); }
//Implement interface - called on event public void OnEventOccured(NotificationsManager.EVENT_TYPE EType = NotificationsManager.EVENT_TYPE.ON_ENEMYDESTROYED, int Param = 0) { Debug.Log("My Event Called"); }