//只能移除动态类型 public virtual void UF_RemoveUI(string key) { if (MapDynamicUI.ContainsKey(key)) { IUIUpdate ui = MapDynamicUI [key]; if (ui is IReleasable) { (ui as IReleasable).Release(); } else if (ui is IOnReset) { (ui as IOnReset).UF_OnReset(); } MapDynamicUI.Remove(key); } }
//只能更改动态加入的UI UpdateKey public bool UF_ChangeUIUpdateKey(string source, string target) { IUIUpdate ui = this.UF_GetDynamicUI(source); if (ui == null) { Debugger.UF_Warn(string.Format("Change UI UpdateKey Failed,Can not find UI[{0}] in Dynamic", source ?? "")); return(false); } else if (MapDynamicUI.ContainsKey(target)) { Debugger.UF_Warn(string.Format("Change UI UpdateKey Failed,Same UI UpdateKey{0}] Has Exist", target ?? "")); return(false); } ui.updateKey = target; //移除原有Key MapDynamicUI.Remove(source); //添加新key MapDynamicUI.Add(target, ui); return(true); }