/// <summary> /// 进入当前窗体并加载到当前集合中 /// </summary> /// <param name="uiFormName"></param> void EnterUIToCurrentCache(string strUIName) { BaseUIForm baseUIForm = null; //如果"正在显示"的集合中,存在整个UI窗体,则直接返回 _DicCurrentShowUIForms.TryGetValue(strUIName, out baseUIForm); if (baseUIForm != null) { return; } //把当前窗体,加载到"正在显示"集合中 _DicALLUIForms.TryGetValue(strUIName, out baseUIForm); if (baseUIForm != null) { _DicCurrentShowUIForms.Add(strUIName, baseUIForm); baseUIForm.Display(); } }
/// <summary> /// UI窗体入栈 /// </summary> /// <param name="uiFormName"></param> void PushUIFormToStack(string strUIName) { BaseUIForm baseUIForm = null; if (_StaCurrentUIForms.Count > 0) { BaseUIForm TopUIForm = _StaCurrentUIForms.Peek(); //冻结栈顶元素 TopUIForm.Freeze(); } //从缓存字典中获取该窗体 _DicALLUIForms.TryGetValue(strUIName, out baseUIForm); if (baseUIForm == null) { Debug.Log("未能获取到该baseUIForm,参数strUIName=" + strUIName); } else { //显示该窗体 baseUIForm.Display(); //该窗体入栈操作 _StaCurrentUIForms.Push(baseUIForm); } }