Exemple #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;
 }
Exemple #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
                    {
                        GameObjectPool.Put(curUi);
                    }

                    continue;
                }

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