Ejemplo n.º 1
0
    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);
    }
Ejemplo n.º 2
0
    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);
        }
    }