void ConfigureFileSource() { _fileSource = new CachingWebFileSource(_configuration.AccessToken, _configuration.GetMapsSkuToken, _configuration.AutoRefreshCache) .AddCache(new MemoryCache(_configuration.MemoryCacheSize)) #if !UNITY_WEBGL .AddCache(new SQLiteCache(_configuration.FileCacheSize)) #endif ; }
/// <summary> /// Clear all existing tile caches. Deletes MBTiles database files. /// </summary> public void ClearSceneCache() { CachingWebFileSource cwfs = _fileSource as CachingWebFileSource; if (null != cwfs) { cwfs.Clear(); } }
void ConfigureFileSource() { _fileSource = new CachingWebFileSource(_configuration.AccessToken) .AddCache(new MemoryCache(_configuration.MemoryCacheSize)) #if !UNITY_WEBGL .AddCache(new MbTilesCache(_configuration.MbTilesCacheSize)) #endif ; }
public void ClearAllCacheFiles() { // explicity call Clear() to close any connections that might be referenced by the current scene CachingWebFileSource cwfs = _fileSource as CachingWebFileSource; if (null != cwfs) { cwfs.Clear(); } // remove all left over files (eg orphaned .journal) from the cache directory string cacheDirectory = Path.Combine(Application.persistentDataPath, "cache"); if (!Directory.Exists(cacheDirectory)) { return; } foreach (var file in Directory.GetFiles(cacheDirectory)) { try { File.Delete(file); } catch (Exception deleteEx) { Debug.LogErrorFormat("Could not delete [{0}]: {1}", file, deleteEx); } } //reinit caches after clear if (null != cwfs) { cwfs.ReInit(); } Debug.Log("done clearing caches"); }
void ConfigureFileSource() { _fileSource = new CachingWebFileSource(_accessToken).AddCache(new MemoryCache(500)); }