/// <summary> /// 显示Ui, 以及关联Ui /// </summary> /// <param name="type"></param> /// <param name="layer"></param> /// <param name="dataList"></param> /// <returns></returns> private BaseUi Show(Type type, UiLayer layer = UiLayer.Normal, params object[] dataList) { HideMutex(type, layer); List <Type> linkedList = UiRelations.Instance.GetLinkedList(type); if (linkedList == null || linkedList.Count <= 0) { return(null); } BaseUi mainUi = null; Type tempType = linkedList[0]; linkedList.RemoveAt(0); linkedList.Add(tempType); for (int i = 0; i < linkedList.Count; i++) { BaseUi ui = GetUiCreateWhenNotFind(linkedList[i]); if (ui != null) { if (ui.GetType() == type) { if (layer != UiLayer.Normal) { ui.layer = layer; } mainUi = ui; } ui.Show(dataList); } } return(mainUi); }
/// <summary> /// 添加已创建的ui /// </summary> /// <param name="ui"></param> /// <returns></returns> public bool AddUi(BaseUi ui) { if (ui != null) { string key = ui.GetType().ToString(); if (!uiDic.ContainsKey(key)) { uiDic.Add(key, ui); return(true); } } return(false); }
/// <summary> /// ui显示方法, 调用BaseUi的显示方法 /// </summary> /// <param name="ui"></param> /// <param name="layer"></param> /// <param name="dataList"></param> /// <returns></returns> private BaseUi Show(BaseUi ui, UiLayer layer = UiLayer.Normal, params object[] dataList) { HideMutex(ui.GetType(), layer); if (ui != null) { if (layer != UiLayer.Normal) { ui.layer = layer; } ui.Show(dataList); } return(ui); }
public bool RemoveUi(BaseUi ui) { return(ui == null ? false : uiDic.Remove(ui.GetType().ToString())); }