public void AddObserver(string notification, defaultNotificationDelegate notificationDelegate) { if (!_notificationMap.ContainsKey(notification)) { #if DEBUG Debug.Log("Adding observer: " + notification + ", " + notificationDelegate.ToString()); #endif _notificationMap.Add(notification, new List<defaultNotificationDelegate>()); } _notificationMap[notification].Add(notificationDelegate); }
public void RemoveObserver(string notification, defaultNotificationDelegate notificationDelegate) { if (!_notificationMap.ContainsKey(notification)) { return; } if (!_notificationMap[notification].Contains(notificationDelegate)) { return; } _notificationMap[notification].Remove(notificationDelegate); }