PopupEventSubscription GetSubscriptionEvent(GamePopup popup) { PopupEventSubscription popupEvent = popupsSubscriptions.Find(item => { return(item.popup == popup); }); if (popupEvent == null) { Debug.LogWarning(debugableInterface.debugLabel + "Couldn't find PopupEventSubscription for popup " + popup.ToString()); return(null); } return(popupEvent); }
public void SubscribeEvent(GamePopup popup, Action callback) { if (!initialized) { Debug.LogError(debugableInterface.debugLabel + "Not initialized"); return; } PopupEventSubscription eventSubscription = GetSubscriptionEvent(popup); if (callback != null) { eventSubscription.AddEvent(callback); } }