Beispiel #1
0
    /// <summary>
    /// 显示面板
    /// </summary>
    /// <param name="panelShowData"></param>
    private UIPanelBase ShowPanel(PanelShowData panelShowData)
    {
        UIPanelBase pBase = GetPanel(panelShowData.PID);

        if (null == pBase)
        {
            Engine.Utility.Log.Error("UIPanelManager->ShowPanel pBase null,pid:{0}", panelShowData.PID);
            return(pBase);
        }

        if (IsShowPanel(panelShowData.PID))
        {
            pBase.PrePanelData = panelShowData.PrePanelData;
            pBase.ShowPanel(panelShowData.Data, jumpData: panelShowData.JumpData);
            Engine.Utility.Log.Warning(CLASS_NAME + "-> ShowPanel failed,panelId = {0} already show!", panelShowData.PID.ToString());
            return(pBase);
        }

        //如果存在互斥面板已经显示则直接返回
        LocalPanelInfo panelInfo = null;

        if (TryGetLocalPanelInfo(panelShowData.PID, out panelInfo))
        {
            List <PanelID> mutexPanels = panelInfo.MutexPanels;
            if (null != mutexPanels)
            {
                for (int i = 0; i < mutexPanels.Count; i++)
                {
                    if (IsShowPanel(mutexPanels[i]))
                    {
                        DealShowPanelMutex(panelShowData.PID);
                        return(null);
                    }
                }
            }
        }



        //if (panelShowData.PID == PanelID.MainPanel || panelShowData.PID == PanelID.MissionAndTeamPanel)
        //{
        //    UIRootHelper.Instance.SetPanelRootStatusByType(PanelRootType.Main, true);
        //}

        ReadyPanel(pBase, panelShowData.IgnoreCache);

        if (pBase.PanelInfo.IsStartPanel || panelShowData.ForceResetPanel)
        {
            pBase.ResetPanel();
        }

        DoShowPanel(pBase, panelShowData.PrePanelData, panelShowData.Data, panelShowData.JumpData);
        if (pBase.PanelInfo.IsStartPanel || panelShowData.ForceClearCacheBack)
        {
            ClearCacheStack();
        }
        return(pBase);
    }
Beispiel #2
0
    /// <summary>
    /// 执行panel显示
    /// </summary>
    /// <param name="panel"></param>
    /// <param name="data"></param>
    private void DoShowPanel(UIPanelBase panel, UIPanelBase.PanelData prePanelData = null, object data = null, UIPanelBase.PanelJumpData jumpData = null)
    {
        panel.PrePanelData = prePanelData;

        UIFrameManager.Instance.ShowUIFrame(panel);
        panel.ShowPanel(data, jumpData);
        if (panel.PanelInfo.CacheLv != PanelCacheLv.None)
        {
            CurShowCachePanel = panel.PanelId;
        }
    }