//-------------------------------------- // 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); } }
//-------------------------------------- // 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(); } }