Example #1
0
 public OpenParam(string uiName, int siblingIndex, PanelUI dialog, UiInitType initType)
 {
     Assert.IsNotNull(uiName, "UI名不能为null");
     UiName       = uiName;
     Dialog       = dialog;
     InitType     = initType;
     SiblingIndex = siblingIndex;
 }
Example #2
0
        private static void CloseUI(PanelUI panelUI, bool force = false)
        {
            if (!force && panelUI.Dialog != null)
            {
                return;
            }

            _CloseStack.Clear();
            _CloseStack.Push(panelUI);

            var back = false;

            while (_CloseStack.Count != 0)
            {
                var curUi = _CloseStack.Peek();

                if (back)
                {
                    _CloseStack.Pop();

                    if (!curUi.CloseCheck())
                    {
                        return;
                    }
                    curUi.BeforeClose();

                    curUi.transform.SetParent(_UIRecycleContainer);
                    _ActiveUI.Remove(curUi);
                    if (curUi.Stable)
                    {
                        _HideStableUI.Add(curUi);
                        curUi.gameObject.SetActive(false);
                    }
                    else
                    {
                        ObjectPool.Put(curUi);
                    }

                    continue;
                }

                if (DialogOpened(curUi.Dialog))
                {
                    _CloseStack.Push(curUi.Dialog);
                }
                else
                {
                    back = true;
                }
            }
        }
Example #3
0
 public static bool DialogOpened(PanelUI dialog)
 {
     return(dialog != null && dialog.gameObject.activeSelf);
 }
Example #4
0
 public static bool IsUIOpened(PanelUI panelUI)
 {
     return(GetUI(panelUI.EntityName) != null);
 }