protected void ReleaseChildPopupList(UListPopup _popupList) { if (!m_PopupListCache.Contains(_popupList)) { m_PopupListCache.Add(_popupList); } if (m_ActivePopupList.Contains(_popupList)) { m_ActivePopupList.Remove(_popupList); } _popupList.Clear(); }
protected void ReleaseChildPopupList(UListComponentPopupBase _popupComponent) { //m_ActivePopupList.ForEach(DeactivateComponent); UListPopup releaseList = null; if (_popupComponent != null) { //有可能是二级菜单的组件 releaseList = _popupComponent.ChildPopupList; if (releaseList == null) { //0号是主列表 for (int i = 1; i < m_ActivePopupList.Count; ++i) { if (m_ActivePopupList[i].Contains(_popupComponent as UListComponentPopup)) { releaseList = m_ActivePopupList[i]; releaseList.Clear(); if (!m_PopupListCache.Contains(releaseList)) { m_PopupListCache.Add(releaseList); } m_ActivePopupList.RemoveAt(i); return; } } return; } } else { return; } if (!m_PopupListCache.Contains(_popupComponent.ChildPopupList)) { m_PopupListCache.Add(_popupComponent.ChildPopupList); } if (m_ActivePopupList.Contains(_popupComponent.ChildPopupList)) { m_ActivePopupList.Remove(_popupComponent.ChildPopupList); } _popupComponent.ChildPopupList.Clear(); _popupComponent.ChildPopupList = null; }