Example #1
0
        /// <summary>
        /// 加载资源包
        /// </summary>
        /// <param name="path">路径</param>
        /// <param name="fileName">资源包名次</param>
        /// <param name="callBack">加载结束回调</param>
        /// <returns>资源包加载类</returns>
        public AssetBundleLoader LoadAssetBundle(string path, string fileName, LoadAssetBundleFinish callBack = null)
        {
            AssetBundleLoader assetBundleLoader = new AssetBundleLoader(path, fileName, null);

            StartCoroutine(LoadAssetBundle(assetBundleLoader, callBack));

            return(assetBundleLoader);
        }
Example #2
0
        /// <summary>
        /// 下载并存储资源包
        /// </summary>
        /// <param name="url">路径</param>
        /// <param name="fileName">资源包名次</param>
        /// <param name="callBack">下载存储结束回调</param>
        /// <returns>资源包加载类</returns>
        public AssetBundleLoader DownLoadAssetBundle(string url, string fileName, LoadAssetBundleFinish callBack = null)
        {
            AssetBundleLoader assetBundleLoader = new AssetBundleLoader(url, fileName, null);

            StartCoroutine(DownloadAndStoreAssetBundle(assetBundleLoader, callBack));

            return(assetBundleLoader);
        }
Example #3
0
        /// <summary>
        /// 加载资源包
        /// </summary>
        /// <param name="assetBundleLoader">资源包下载类</param>
        /// <param name="path">网络路径</param>
        /// <param name="fileName">资源包名</param>
        /// <returns></returns>
        private IEnumerator LoadAssetBundle(AssetBundleLoader assetBundleLoader, LoadAssetBundleFinish callBack)
        {
            yield return(StartCoroutine(assetBundleLoader.LoadAssetBundle(false, false)));

            //下载存储完成后的回调
            if (callBack != null)
            {
                callBack(assetBundleLoader);
            }
        }
Example #4
0
        ///methods

        /// <summary>
        /// 下载并存储资源包
        /// </summary>
        /// <param name="assetBundleLoader">资源包下载类</param>
        /// <param name="path">网络路径</param>
        /// <param name="fileName">资源包名</param>
        /// <returns></returns>
        private IEnumerator DownloadAndStoreAssetBundle(AssetBundleLoader assetBundleLoader, LoadAssetBundleFinish callBack)
        {
            yield return(StartCoroutine(assetBundleLoader.LoadAssetBundle(true, true)));

            //下载存储完成后的回调
            if (callBack != null)
            {
                callBack(assetBundleLoader);
            }
        }