示例#1
0
 public override void Dispose()
 {
     base.Dispose();
     _fileCache         = null;
     AssetInfo          = null;
     _onLoadingComplete = null;
 }
示例#2
0
 public VersionedDiskCachedResourceWorker(AssetFileInfo assetInfo, string uri, Action <VersionedDiskCachedResourceWorker> onLoadingComplete,
                                          ICoroutineManager coroutineManager, IAntiCacheUrlResolver antiCacheUrlResolver, WebRequestSettings webRequestSettings = null) :
     base(uri, null, coroutineManager, antiCacheUrlResolver, webRequestSettings)
 {
     AssetInfo            = assetInfo;
     _onLoadingComplete   = onLoadingComplete;
     _isLoadFromFileCache = false;
 }
示例#3
0
 public VersionedDiskCachedResourceWorker(string uri, AssetFileInfo assetInfo, ICache <byte[]> fileCache, Action <VersionedDiskCachedResourceWorker> onLoadingComplete,
                                          ICoroutineManager coroutineManager) :
     base(uri, null, coroutineManager, null)
 {
     AssetInfo            = assetInfo;
     _fileCache           = fileCache;
     _onLoadingComplete   = onLoadingComplete;
     _isLoadFromFileCache = true;
 }
        private void RemoveOldResourceFromDiskCache(AssetFileInfo resourceInfo)
        {
            if (resourceInfo.version > 0)
            {
                var oldVersionREsources = resourceInfo.GetOldVersionedResourceName().ToList();

                for (int i = 0; i < oldVersionREsources.Count; i++)
                {
                    oldVersionREsources[i] = UrlHelper.GetUriWithPrefix(SupportsMask, oldVersionREsources[i]);
                }

                _memoryCache.ReleaseResources(null, oldVersionREsources);
                _fileCaching.ReleaseResources(null, oldVersionREsources);
            }
        }