public void Setup(PolyCacheConfig config) { // Create all the buffer holders. They are all initially idle. for (int i = 0; i < MAX_CONCURRENT_DOWNLOADS; i++) { idleBuffers.Add(new BufferHolder()); } // Caching is only supported on Windows/Mac for now. bool cacheSupported = Application.platform == RuntimePlatform.WindowsEditor || Application.platform == RuntimePlatform.WindowsPlayer || Application.platform == RuntimePlatform.OSXEditor || Application.platform == RuntimePlatform.OSXPlayer; PtDebug.LogFormat("Platform: {0}, cache supported: {1}", Application.platform, cacheSupported); if (cacheSupported && config.cacheEnabled) { //string appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); //string defaultCachePath = Path.Combine(Path.Combine(Path.Combine( // appDataPath, Application.companyName), Application.productName), "WebRequestCache"); string defaultCachePath = Path.Combine(Application.persistentDataPath, "WebRequestCache"); string cachePath = config.cachePathOverride; if (string.IsNullOrEmpty(cachePath)) { cachePath = defaultCachePath; } // Note: Directory.CreateDirectory creates all directories in the path. Directory.CreateDirectory(cachePath); cache = gameObject.AddComponent <PersistentBlobCache>(); cache.Setup(cachePath, config.maxCacheEntries, config.maxCacheSizeMb * 1024 * 1024); } }