Пример #1
0
        public TBaseUI CancelShowUI <TBaseUI>() where TBaseUI : IBaseUIForm
        {
            string      uiName = typeof(TBaseUI).Name;
            IBaseUIForm uiForm = UIMonoManager.GetCurrentOpenUI(uiName);

            if (uiForm == null)
            {
                uiForm = GetUI <TBaseUI>();
            }
            UIMonoManager.Instance.CancelShowUI(uiForm);
            return(uiForm as TBaseUI);
        }
Пример #2
0
        public IBaseUIForm OpenUI(float time = 0, params object[] paramVaules)
        {
            if (UIMonoManager.IsOpenUI(this.name) == false)
            {
                OpenUI(this, time, paramVaules);
            }
            else
            {
                Debug.LogWarning("当前窗口已经打开 openUI :" + this.name);
            }

            return(this);
        }
Пример #3
0
        /// <summary>
        /// 打开UI
        /// </summary>
        /// <param UIName="openUIName">UI 名字</param>
        /// <param UIName="openOP"> 要打开UI的操作 </param>
        /// <param UIName="closeOP"> 当前UI的操作 </param>
        public TBaseUI OpenUI <TBaseUI>(float time = 0, params object[] paramVaules) where TBaseUI : IBaseUIForm
        {
            string      uiName = typeof(TBaseUI).Name;
            IBaseUIForm uiForm = UIMonoManager.GetCurrentOpenUI(uiName);

            if (uiForm == null)
            {
                uiForm = GetUI <TBaseUI>();
                return(OpenUI(uiForm, time, paramVaules) as TBaseUI);
            }

            return(uiForm as TBaseUI);
        }
Пример #4
0
        /// <summary>
        /// 关闭指定UI
        /// </summary>
        /// <typeparam UIName="TBaseUI"></typeparam>
        /// <param UIName="closeOP"></param>
        public TBaseUI CloseUI <TBaseUI>(float time = 0, params object[] paramValues) where TBaseUI : IBaseUIForm
        {
            string      uiName = typeof(TBaseUI).Name;
            IBaseUIForm uiForm = UIMonoManager.GetCurrentOpenUI(uiName);

            if (uiForm != null)
            {
                return(CloseUI(uiForm, time, paramValues) as TBaseUI);
            }
            else
            {
                if (UIMonoManager.ExistNewInstanceUI(uiName))
                {
                    Debug.LogError("NewInstance 窗口类型 不能通过泛型方法关闭");
                    return(null);
                }

                Debug.LogError("当前窗口没有打开 closeUI :" + uiName);
            }

            return(null);
        }
Пример #5
0
 public IBaseUIForm GetUI(string uiName)
 {
     return(UIMonoManager.GetUI(uiName));
 }
Пример #6
0
        public TBaseUI GetUI <TBaseUI>() where TBaseUI : IBaseUIForm
        {
            string uiNmae = typeof(TBaseUI).Name;

            return(UIMonoManager.GetUI(uiNmae) as TBaseUI);
        }