/// <summary> /// Unsubscribes day listener. /// </summary> /// <param name="dayListener"></param> /// <returns>true if successfully removed.</returns> public bool Unsubscribe(IDayListener dayListener) { if (!DayListeners.Contains(dayListener)) { return(false); } DayListeners.Remove(dayListener); Debug.Log(dayListener + " removed from listeners"); return(true); }
/// <summary> /// Subscribes day listener. /// </summary> /// <param name="dayListener"></param> /// <returns>true, if successfully added.</returns> public bool Subscribe(IDayListener dayListener) { if (dayListener == null && DayListeners.Contains(dayListener)) { return(false); } DayListeners.Add(dayListener); Debug.Log(dayListener + " added to listeners"); return(true); }