Beispiel #1
0
    public void PopPanel(bool isRemove = true)        //页面弹出
    {
        if (panelStack == null)
        {
            panelStack = new Stack <BasePanel>();
        }
        if (panelStack.Count <= 0)
        {
            return;
        }

        BasePanel topPanel = panelStack.Pop();

        if (isRemove)
        {
            panelDict.Remove(topPanel.GetUIPanelType());             //页面销毁后清除字典中的垃圾数据
        }
        //Debug.Log(topPanel.name + "出栈");
        topPanel.OnExit();                              //调用栈顶页面退出事件


        if (panelStack.Count <= 0)
        {
            return;                                         //如果栈内还存在页面,则将其canvasblock改变 激活
        }
        topPanel = panelStack.Peek();
        topPanel.OnResume();
    }
Beispiel #2
0
    public void RemovePanelList(UIPanelType uIPanelType)        //页面出队
    {
        if (panelList == null)
        {
            panelList = new List <BasePanel>();
        }
        if (panelList.Count <= 0)
        {
            return;
        }
        if (panelList.IndexOf(GetPanel(uIPanelType)) < 0)
        {
            return;
        }

        BasePanel removePanel = GetPanel(uIPanelType);

        //Debug.Log(removePanel.name + "出队");
        panelList.Remove(removePanel);                      //页面销毁后清除字典中的垃圾数据
        panelDict.Remove(removePanel.GetUIPanelType());

        removePanel.OnExit();                              //调用栈顶页面退出事件
        if (panelStack != null)                            //对栈内面板响应对应的时间系统
        {
            panelStack.Peek().ListPanelRemoveEvent(uIPanelType);
        }
    }