示例#1
0
    public IUIBaseCtrl ShowPanel(string panelStr, bool modal = true)
    {
        string      nname  = panelStr;
        IUIBaseCtrl UICtrl = null;

        if (mUIPanelMap.ContainsKey(panelStr))
        {
            UICtrl = mUIPanelMap[panelStr];
            //更换顺序
            mUILayerList.Remove(UICtrl);
            mUILayerList.Add(UICtrl);
        }
        else
        {
            Type type = mUITypeMap[nname];
            UICtrl = (IUIBaseCtrl)Activator.CreateInstance(type);
            if (UICtrl != null)
            {
                UICtrl.Setup(panelStr, this);
                mUIPanelMap[nname] = UICtrl;
                mUILayerList.Add(UICtrl);
            }
        }
        AdjustLayerOrder(modal);
        return(UICtrl);
    }
示例#2
0
    public void CloseCertainPanel(IUIBaseCtrl toClose)
    {
        string name = toClose.nameStr;

        if (mUIPanelMap.ContainsKey(name))
        {
            mUILayerList.Remove(toClose);
            mUIPanelMap.Remove(name);
            toClose.Release();
        }
        else
        {
            if (mUILayerList.Contains(toClose))
            {
                toClose.Release();
                mUILayerList.Remove(toClose);
            }
            else
            {
                Debug.Log("close not exitst ui panel");
            }
        }
        AdjustLayerOrder();
        CloseLastMask();
    }
示例#3
0
    public void CloseLastMask()
    {
        if (mUILayerList.Count == 0)
        {
            return;
        }
        IUIBaseCtrl ctrl = mUILayerList[mUILayerList.Count - 1];

        ctrl.CloseLastMask();
    }
示例#4
0
    public void CloseFirstPanel()
    {
        if (mUILayerList.Count == 0)
        {
            return;
        }
        IUIBaseCtrl ctrl = mUILayerList[mUILayerList.Count - 1];

        ctrl.Release();
        mUILayerList.RemoveAt(mUILayerList.Count - 1);
        mUIPanelMap.Remove(ctrl.nameStr);
        AdjustLayerOrder();
    }