/// <summary> /// 设定打开或者关闭已开UI, /// </summary> /// <param name="isOpen"></param> public void SetShowAllOpenUI(bool isOpen) { if (m_openUIbaseList == null || m_openUIbaseList.Count == 0) { return; } APanelBase curPanel = null; if (isOpen) { for (int i = 0; i < m_openUIbaseList.Count; i++) { curPanel = m_openUIbaseList[i]; if (_tempHideList.Contains(curPanel) && !curPanel.isFilm && curPanel.m_IsKeepOpen) //还原隐藏也只还原强制隐藏 { curPanel.EndPauseHide(); _tempHideList.Remove(curPanel); } } } else { _tempHideList.Clear(); //添加临时列表,记录强制隐藏的界面 for (int i = 0; i < m_openUIbaseList.Count; i++) { curPanel = m_openUIbaseList[i]; if (!curPanel.isFilm && !curPanel.m_IsKeepOpen && curPanel.IsOpen) { curPanel.StartPauseHide(); _tempHideList.Add(curPanel); } } } }
/// <summary> /// 打开UI /// </summary> /// <param name="uibaseName"></param> public void ShowUI(string uibaseName, bool isSaveShow = false, Action <APanelBase> closeCall = null, Action <APanelBase> openCall = null, bool isClearAll = true) { if (m_uIbaseDic.ContainsKey(uibaseName)) { Action Call = () => { if (!isSaveShow) { if (!m_uIbaseDic[uibaseName].isFilm && isClearAll) { CloseAllUI(false); } closeCall += (panel) => { m_openUIbaseList.Remove(panel); }; m_uIbaseDic[uibaseName].ShowUI(uibaseName, openCall, closeCall); m_openUIbaseList.Add(m_uIbaseDic[uibaseName]); } else { APanelBase lastBase = GetShowAndNoFilmUI(); m_uIbaseDic[uibaseName].ShowUI(uibaseName, openCall, closeCall); if (!m_openUIbaseList.Contains(m_uIbaseDic[uibaseName])) { m_openUIbaseList.Add(m_uIbaseDic[uibaseName]); } if (lastBase != null) { lastBase.StartPauseHide(); m_uIbaseDic[uibaseName]. OnCloseEvent += (panel) => lastBase.EndPauseHide(); } } }; /* * if (m_uIbaseDic[uibaseName].m_gameobj != null) * Call(); * else*/ m_uIbaseDic[uibaseName].LoadRefer(Call, m_uIbaseDic[uibaseName].m_IsLoadFromResources); //JResource.LoadResAsync<GameObject>(ResPath.Instance.GetUIPath(uibaseName), Call, JResource.MatchMode.UI); } }