Ejemplo n.º 1
0
    private void PushPanel(string pageName, UIBasePanel pageInstance, Action callback, object pageData, bool isAsync)
    {
        if (string.IsNullOrEmpty(pageName) || pageInstance == null)
        {
            Debug.LogError("[UI] show page error with :" + pageName + " maybe null instance.");
            return;
        }

        if (mOpenedUIList.ContainsKey(pageName))
        {
            mCurrPage = mOpenedUIList[pageName];
        }
        else
        {
            mOpenedUIList.Add(pageName, pageInstance);
            mCurrPage = pageInstance;
        }
        if (pageData != null)
        {
            mCurrPage.SetData(pageData);
        }

        mCurrPage.OnEnter();
        SetNavigationStack(mCurrPage);

        //if (isAsync)
        //    curPanel.Show(callback);
        //else

        //DebugHelper.LogInfo(mNavigationStack.Count);
    }
Ejemplo n.º 2
0
    /// <summary>
    /// 入栈并显示面板
    /// </summary>
    public void PushPanel(UIPanelType panelType)
    {
        // 暂停上一级的页面
        if (m_PanelStack.Count > 0)
        {
            UIBasePanel topPanel = m_PanelStack.Peek();
            topPanel.OnPause();
        }
        UIBasePanel panel = GetPanel(panelType);

        panel.OnEnter();
        m_PanelStack.Push(panel);
    }
Ejemplo n.º 3
0
    /// <summary>
    /// 入栈并显示面板
    /// </summary>
    public void PushPanel(UIPanelType panelType)
    {
        UIBasePanel panel = GetPanel(panelType);

        if (m_PanelStack.Count > 0)
        {
            UIBasePanel topPanel = m_PanelStack.Peek();
            if (topPanel.name == panel.name)
            {
                return;
            }

            topPanel.OnPause();
        }
        panel.transform.SetAsLastSibling();
        m_PanelStack.Push(panel);
        panel.OnEnter();
    }