Example #1
0
        /// <summary>
        /// 设定打开或者关闭已开UI,
        /// </summary>
        /// <param name="isOpen"></param>
        public void SetShowAllOpenUI(bool isOpen)
        {
            if (m_openUIbaseList == null || m_openUIbaseList.Count == 0)
            {
                return;
            }

            APanelBase curPanel = null;

            if (isOpen)
            {
                for (int i = 0; i < m_openUIbaseList.Count; i++)
                {
                    curPanel = m_openUIbaseList[i];
                    if (_tempHideList.Contains(curPanel) && !curPanel.isFilm && curPanel.m_IsKeepOpen)  //还原隐藏也只还原强制隐藏
                    {
                        curPanel.EndPauseHide();
                        _tempHideList.Remove(curPanel);
                    }
                }
            }
            else
            {
                _tempHideList.Clear();   //添加临时列表,记录强制隐藏的界面
                for (int i = 0; i < m_openUIbaseList.Count; i++)
                {
                    curPanel = m_openUIbaseList[i];
                    if (!curPanel.isFilm && !curPanel.m_IsKeepOpen && curPanel.IsOpen)
                    {
                        curPanel.StartPauseHide();
                        _tempHideList.Add(curPanel);
                    }
                }
            }
        }
Example #2
0
 /// <summary>
 /// 预加载UI
 /// </summary>
 public void PreLoadGroupUIRes(APanelBase panel)
 {
     if (panel == null)
     {
         return;
     }
     PreLoadGroupRes(panel.GetReferList);
 }
Example #3
0
        public void CloseAndDestoryUI(string uibaseName)
        {
            APanelBase uibase = GetUI(uibaseName);

            if (uibase != null)
            {
                uibase.CloseUI();
                uibase.Destroy();
            }
        }
Example #4
0
        public void DestoryUI(string uibaseName)
        {
            APanelBase uibase = GetUI(uibaseName);

            if (uibase != null)
            {
                m_uIbaseDic.Remove(uibaseName);
                uibase.Destroy();
            }
        }
Example #5
0
        public APanelBase GetUI(string uibaseName)
        {
            APanelBase ui = null;

            if (m_uIbaseDic.ContainsKey(uibaseName))
            {
                ui = m_uIbaseDic[uibaseName];
                if (ui.m_gameobj == null)
                {
                    ui = null;
                }
            }
            return(ui);
        }
Example #6
0
        /// <summary>
        /// 打开UI
        /// </summary>
        /// <param name="uibaseName"></param>
        public void ShowUI(string uibaseName, bool isSaveShow = false, Action <APanelBase> closeCall = null, Action <APanelBase> openCall = null, bool isClearAll = true)
        {
            if (m_uIbaseDic.ContainsKey(uibaseName))
            {
                Action Call = () =>
                {
                    if (!isSaveShow)
                    {
                        if (!m_uIbaseDic[uibaseName].isFilm && isClearAll)
                        {
                            CloseAllUI(false);
                        }

                        closeCall += (panel) => { m_openUIbaseList.Remove(panel); };

                        m_uIbaseDic[uibaseName].ShowUI(uibaseName, openCall, closeCall);
                        m_openUIbaseList.Add(m_uIbaseDic[uibaseName]);
                    }
                    else
                    {
                        APanelBase lastBase = GetShowAndNoFilmUI();
                        m_uIbaseDic[uibaseName].ShowUI(uibaseName, openCall, closeCall);

                        if (!m_openUIbaseList.Contains(m_uIbaseDic[uibaseName]))
                        {
                            m_openUIbaseList.Add(m_uIbaseDic[uibaseName]);
                        }

                        if (lastBase != null)
                        {
                            lastBase.StartPauseHide();
                            m_uIbaseDic[uibaseName].
                            OnCloseEvent += (panel) => lastBase.EndPauseHide();
                        }
                    }
                };

                /*
                 * if (m_uIbaseDic[uibaseName].m_gameobj != null)
                 *  Call();
                 * else*/
                m_uIbaseDic[uibaseName].LoadRefer(Call, m_uIbaseDic[uibaseName].m_IsLoadFromResources);
                //JResource.LoadResAsync<GameObject>(ResPath.Instance.GetUIPath(uibaseName), Call, JResource.MatchMode.UI);
            }
        }
Example #7
0
        public void CloseAllUI()
        {
            if (m_openUIbaseList == null || m_openUIbaseList.Count <= 0)
            {
                return;
            }

            for (int i = m_openUIbaseList.Count - 1; i >= 0; i--)
            {
                APanelBase ui = m_openUIbaseList[i];
                if (!ui.m_IsAlwaysOpen)
                {
                    ui.OnCloseEvent = null;
                    ui.CloseUI();
                    m_openUIbaseList.Remove(ui);
                }
            }
        }
Example #8
0
 public UIAnchorControl(APanelBase panel)
 {
     this.m_panel = panel;
 }
 public UIReleaseControl(APanelBase panel)
 {
     m_panel = panel;
 }
 public UISoundControl(APanelBase panel)
 {
     this.m_panel = panel;
 }