Exemplo n.º 1
0
        public bool IsLoadingOrLoaded(string abName)
        {
            if (cache.InCache(abName))
            {
                return(true);
            }

            if (cache.InWWWCache(abName))
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 检查是否已经从网络下载
        /// </summary>
        protected WWW IsLoadAssetBundleAtInternal(string assetBundleName)
        {
            //已经存在了呀
            LOAssetBundle bundle = LOAssetCache.GetBundleCache(assetBundleName);

            if (bundle != null)
            {
                //保留一次
                bundle.Retain();
                return(null);
            }

            //如果WWW缓存策略中包含有对应的关键字,则返回null
            if (LOAssetCache.InWWWCache(assetBundleName))
            {
                return(null);
            }
            //创建下载链接
            WWW www = new WWW(LOAssetManager.URI + assetBundleName);

            //加入缓存策略
            LOAssetCache.SetWWWCache(assetBundleName, www);

            return(www);
        }