public void RemoveAlert(TDBaseAlertData alert) { if (alert == null) { return; } Data.Remove(alert); Callback_OnRemoved?.Invoke(alert); alert.OnBeRemoved(); alert.OnEnd(); AddToCache(alert); IDMgr.Remove(alert.ID); }
public void Update() { ClearDatas.Clear(); foreach (var item in this) { item.Value.Update(); if (item.Value.IsOver()) { ClearDatas.Add(item.Key); } } foreach (var item in ClearDatas) { this.Remove(item); Callback_OnRemoved?.Invoke(item); } }
public void Remove(TData alert) { if (alert == null) { return; } alert.OnBeRemoved(); Data.Remove(alert); if (alert.Type == AlertType.Interaction) { InteractionData.Remove(alert); Callback_OnInteractionChange?.Invoke(alert); } else if (alert.Type == AlertType.Disposable) { DisposableData.Remove(alert); Callback_DisposableChange?.Invoke(alert); } else if (alert.Type == AlertType.Continue) { ContinueData.Remove(alert); Callback_ContinueChange?.Invoke(alert); } //移除Article foreach (var item in alert.SelfArticle) { ArticleMgr.RemoveArticle(item); } foreach (var item in alert.TargetArticle) { ArticleMgr.RemoveArticle(item); } if (BaseGlobal.IsUnReadData) { Callback_OnRemoved?.Invoke(alert); } }
public void RemoveSkill(TData data) { Callback_OnRemoved?.Invoke(data); _baseSkills.Remove(data); data.Callback_OnCDOver -= OnSkillCDOver; }