Пример #1
0
        /// <summary>
        /// 获取一个UI的接口
        /// </summary>
        /// <param name="uiName"></param>
        /// <returns></returns>
        public MUIBase GetUI(string uiName)
        {
            MUIBase mUIBase = null;

            m_uiDict.TryGetValue(uiName, out mUIBase);
            return(mUIBase);
        }
Пример #2
0
        public T GetUI <T>(string uiName) where T : MUIBase
        {
            MUIBase mUIBase = null;

            if (m_uiDict.TryGetValue(uiName, out mUIBase))
            {
                if (mUIBase is T)
                {
                    return((T)mUIBase);
                }
            }
            return(null);
        }
Пример #3
0
        /// <summary>
        /// 打开一个UI的接口
        /// </summary>
        /// <param name="uiName"></param>
        /// <returns></returns>
        public MUIBase ActiveUI(string uiName)
        {
            MUIBase mUIBase = GetUI(uiName);

            if (mUIBase == null)
            {
                Debug.LogError("UIDic里面没有这个UI信息 UIName:" + uiName);
                return(null);
            }

            if (!mUIBase.IsInited)
            {
                mUIBase.Init();
            }

            return(mUIBase);
        }
Пример #4
0
        /// <summary>
        /// 关闭一个UI的接口
        /// </summary>
        /// <param name="uiName"></param>
        public void DeActiveUI(string uiName)
        {
            MUIBase mUIBase = GetUI(uiName);

            if (mUIBase == null)
            {
                Debug.LogError("UIDic里面没有这个UI信息 UIName:" + uiName);
                return;
            }

            if (mUIBase.IsInited)
            {
                if (mUIBase.Active)
                {
                    mUIBase.Active = false;
                }
                mUIBase.Uninit();
            }
        }