private void LoadUI(UIConfig vo, UIModelBase model, bool closePrevPanel) { UIViewBase view = null; if (!_cachedViews.TryGetValue(vo, out view)) { GameObject prefab = TxResource.Instance.LoadGameObject(vo.MainModuleResPath); view = prefab.GetComponent <UIViewBase>(); _cachedViews.Add(vo, view); } AddToStack(vo, closePrevPanel); LoadUIOk(vo, model, view); }
private void HideUI(UIConfig vo) { if (vo.PopUpType == LayerType.Panel) { List <UIConfig> alertList; if (_alertListOfPanelDic.TryGetValue(vo, out alertList)) { for (int i = 0; i < alertList.Count; i++) { HideUI(alertList[i]); } } } vo.State = 0; UIViewBase view = _cachedViews[vo]; view.gameObject.SetActive(false); view.Hide(); }
private void CloseUI(UIConfig vo) { if (vo.PopUpType == LayerType.Panel) { List <UIConfig> alertList; if (_alertListOfPanelDic.TryGetValue(vo, out alertList)) { while (alertList.Count > 0) { CloseUI(alertList[0]); } } } PopStack(vo); vo.State = 0; UIViewBase view = _cachedViews[vo]; view.gameObject.SetActive(false); view.Close(); }
private void ShowUI(UIConfig vo) { vo.State = 1; UIViewBase view = _cachedViews[vo]; view.gameObject.SetActive(true); view.Show(); view.transform.SetAsLastSibling(); if (vo.PopUpType == LayerType.Panel) { _currentPanelConfig = vo; List <UIConfig> alertList; if (_alertListOfPanelDic.TryGetValue(vo, out alertList)) { for (int i = 0; i < alertList.Count; i++) { ShowUI(alertList[i]); } } } }