示例#1
0
        public void OpenAsync(string AssestPath, IUIData UIData, Action <IBaseUI> finishCallback = null, bool bMonoBehaviour = false)
        {
            IBaseUI ui = CheckCache(AssestPath, UIData);

            if (ui != null)
            {
                if (finishCallback != null)
                {
                    finishCallback.Invoke(ui);
                }
                return;
            }
            IAssurerLoader loader = VLoader.EasyGet();

            CreateUIAsync(AssestPath, (UI) => {
                if (UI == null && finishCallback != null)
                {
                    finishCallback.Invoke(null);
                    return;
                }
                Push(UI, UIData);
                UI.Init(AssestPath, UIData, loader, bMonoBehaviour);
                UI.Show();
                if (finishCallback != null)
                {
                    finishCallback.Invoke(UI);
                }
            }, ref loader);
        }
示例#2
0
        /// <summary>
        /// 通用打开方法
        /// </summary>
        /// <param name="AssestPath">资产路径</param>
        /// <param name="UIData">UI数据</param>
        /// <param name="bMonoBehaviour">UI是否开启生命周期</param>
        public IBaseUI Open(string AssestPath, IUIData UIData, bool bMonoBehaviour = false)
        {
            IBaseUI UI = CheckCache(AssestPath, UIData);

            if (UI != null)
            {
                return(UI);
            }
            IAssurerLoader loader = VLoader.EasyGet();

            UI = CreateUISync(AssestPath, ref loader);
            if (UI == null)
            {
                return(UI);
            }

            Push(UI, UIData);
            UI.Init(AssestPath, UIData, loader, bMonoBehaviour);
            UI.Show();

            return(UI);
        }
示例#3
0
 public static void RecycleSelf(this VLoader loader)
 {
     EasyPool <VLoader> .Instance.Recycle(loader);
 }