예제 #1
0
        /// <summary>
        /// 检查当前运行 curAssetBundleLoader 是否加载完成
        /// </summary>
        void Check()
        {
            if (isStop)
            {
                curAssetBundleLoader.Stop();

                curAssetBundleLoader = null;

                Debug.LogWarningFormat(" Stop in Check() !");
            }

            if (curAssetBundleLoader.IsCmp())
            {
                if (curAssetBundleLoader.assetBundle == null)
                {
                    Debug.LogErrorFormat("AssetBundle {0} 加载失败!", curAssetBundleLoader.name);
                    //重置流
                    curAssetBundleLoader = null;
                    return;
                }

                if (curAssetBundleLoader.referenceCount > 0)
                {
                    CacheNewOne(curAssetBundleLoader);
                    //回调完成委托
                    curAssetBundleLoader.CallBack();

                    if (debugLog)
                    {
                        Debug.LogFormat(" AssetBundleLoader {0}, 加载完成!,队列总数 {1}", curAssetBundleLoader.name, waiting.Count);
                    }
                }
                else
                {
                    curAssetBundleLoader.Clear();

                    Debug.LogWarningFormat(" AssetBundleLoader {0}, referenceCount = 0 Clear !", curAssetBundleLoader.name);
                }
                //重置流
                curAssetBundleLoader = null;
            }
            else
            {
                //正在加载中!
                //Debug.Log("curAssetBundleLoader = " + curAssetBundleLoader.progress());
            }
        }
예제 #2
0
        /// <summary>
        /// 检查当前运行 curAssetBundleLoader 是否加载完成
        /// </summary>
        void Check()
        {
            if (curAssetBundleLoader.IsCmp())
            {
                if (curAssetBundleLoader.assetBundle == null)
                {
                    Debug.LogErrorFormat("AssetBundle {0} 加载失败", curAssetBundleLoader.name);
                    //重置流
                    curAssetBundleLoader = null;
                    return;
                }

                CacheNewOne(curAssetBundleLoader);

                //回调完成委托

                /*
                 * if (curAssetBundleLoader.onLoadAssetBundle != null)
                 * {
                 * curAssetBundleLoader.onLoadAssetBundle(curAssetBundleLoader.name,
                 *                         curAssetBundleLoader.assetBundle);
                 * }*/
                curAssetBundleLoader.CallBack();

                /* 调试委托调用
                 * System.Delegate[] invocationList = curAssetBundleLoader.onLoadAssetBundle.GetInvocationList();
                 * for (int i = 0; i < invocationList.Length; i++)
                 * {
                 *  invocationList[i].DynamicInvoke(
                 *      curAssetBundleLoader.name,
                 *      curAssetBundleLoader.assetBundle);
                 * }*/

                if (debugLog)
                {
                    Debug.LogFormat(" AssetBundleLoader {0}, 加载完成!,队列总数 {1}", curAssetBundleLoader.name, waiting.Count);
                }

                //重置流
                curAssetBundleLoader = null;
            }
            else
            {
                //正在加载中!
                //Debug.Log("curAssetBundleLoader = " + curAssetBundleLoader.progress());
            }
        }