Beispiel #1
0
    //--------------------------------------
    //  PUBLIC METHODS
    //--------------------------------------

    public void AddAction(AlertActionType type, string title, AlertPopupAction callback)
    {
        if (actions.Count >= MAX_ACTIONS)
        {
            Debug.LogWarning("Action NOT added! Actions limit exceeded");
        }
        else if (actions.ContainsKey(title) || actionIdentifiers.ContainsKey(type))
        {
            Debug.LogWarning("Action NOT added! Action with this Title or Type already exists");
        }
        else
        {
            actionIdentifiers.Add(type, title);
            actions.Add(title, callback);
        }
    }
Beispiel #2
0
    //--------------------------------------
    //  EVENTS
    //--------------------------------------

    void OnPopupCompleted(string result)
    {
        if (debugOnCompleted != null)
        {
            debugOnCompleted.Invoke(result);
        }

        AlertActionType actionType = GetAlertActionType(result);

        if (actionType == AlertActionType.Dismiss)
        {
            if (result.Equals(DISMISS_ACTION) && dismissCallback != null)
            {
                dismissCallback.Invoke();
            }
        }
        else
        {
            actions[actionIdentifiers[actionType]].Invoke();
        }
    }