public void ShowPanel(ID_PANEL panelId, params object[] args) { IPanel panel; if (!mPanels.ContainsKey(panelId)) { System.Type type = System.Type.GetType(panelId.ToString()); System.Object objcet = System.Activator.CreateInstance(type); panel = (IPanel)objcet; mPanels[panelId] = panel; } else { panel = mPanels[panelId]; } if (!panel.IsLoad) { GameObject go = CreateUIPrefab(panelId.ToString()); UISerializeManager.GetInstance().DeSerialize(panel, go); panel.Go = go; } panel.Show(args); if (panelId != ID_PANEL.PromptPanel) { if (curShowPanel != null) { curShowPanel.Hide(); } curShowPanel = panel; } else { panel.Go.transform.SetAsLastSibling(); } }
/// <summary> /// 隐藏UI /// </summary> /// <param name="uiBehaviourName"></param> public void HideUI(string uiBehaviourName) { IPanel iuiPanel = null; if (mAllUI.TryGetValue(uiBehaviourName, out iuiPanel)) { iuiPanel.Hide(); } }
public void CallPreviousPanel(UMUI.Data data) { var temp = currentPanel; currentPanel?.Hide(); previousPanel?.Show(data); currentPanel = previousPanel; previousPanel = temp; }
public void AddChild(IPanel panel) { lock (_syncroot) { panel.Blur(); panel.Hide(); panel.Parent = this as IPanelHost; panel.Environment = this as IEnvironment; panel.PanelChanged += OnPanelChanged; _panels.Add(panel); panel.Invalidate(); } }
/// <summary> /// 隐藏所有常驻内存的UI,跳过动态加载的UI /// </summary> public void HideAllPanelExceptSecendLevelUI(bool disable) { foreach (KeyValuePair <string, IPanel> data in panelDic) { if (secendLevelPanelDic.ContainsKey(data.Key)) { continue; } IPanel panel = data.Value; panel.Hide(disable); } }
/// <summary> /// 隐藏所有的UI, 动态加载的UI不会被卸载,只会被隐藏,慎用!! /// </summary> public void HideAllPanel(bool disable) { List <string> bufferList = new List <string>(panelDic.Keys); foreach (string str in bufferList) { if (panelDic.ContainsKey(str)) { IPanel panel = panelDic[str]; if (panel != null) { panel.Hide(disable); } } } }