void CloseUIById(int id) { if (m_UIList.ContainsKey(id)) { WindowBase winbs = m_UIList[id]; winbs.F_RemoveSound(); winbs.UnRegisterEvent(); winbs.F_OnRemove(); m_UIList.Remove(id); RemoveEUIToIdDec(winbs.F_GetEUI(), id); m_IdPosList.Remove(id); m_DataModule.Remove(id); Unload(winbs); } }
/// <summary> /// 最上层 /// </summary> /// <param name="tmpTop"></param> void OnTopWin(WindowBase tmpTop) { if (tmpTop != null) { if (topWinBase == null) { topWinBase = tmpTop; topWinBase.F_TopWin(true); return; } if (tmpTop.F_GetEUI() != TopWinBase.F_GetEUI()) { topWinBase.F_TopWin(false); topWinBase = tmpTop; topWinBase.F_TopWin(true); } } }
/// <summary> /// 通过 eui关闭界面 /// </summary> /// <param name="eui"></param> /// <param name="isDestroy"></param> public void F_CloseUI(T_UIConfig.E_UI eui) { T_UIConfig.UI_TYPE type = CheckUIType(eui); for (int i = m_IdPosList.Count - 1; i >= 0; i--) { int id = m_IdPosList[i]; if (m_UIList.ContainsKey(id)) { WindowBase winb = m_UIList[id]; if (winb.F_GetEUI() == eui) { CloseUIById(id); } } } ResetDepth(type); SetFullScreenMask(); }
/// <summary> /// 检查是否是最上层 /// </summary> /// <param name="winbs"></param> void CheckTop(WindowBase winbs, ref WindowBase tmpTop) { T_UIConfig config = GetConfigData(winbs.F_GetEUI()); if (config == null) { return; } if (config.TopFilter == true) { return; } if (tmpTop == null) { tmpTop = winbs; } else { if ((int)winbs.F_GetUIType() >= (int)tmpTop.F_GetUIType()) { tmpTop = winbs; } } }