mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2025-10-09 06:15:24 +00:00
[adapters] 增加主线程的类型提示文件,优化多线程通信方式,增加对多线程自定义扩展的支持
This commit is contained in:
@@ -111,19 +111,19 @@ var cacheManager = {
|
||||
|
||||
init() {
|
||||
this._cacheDir = getUserDataPath() + '/' + this.cacheDir;
|
||||
worker.cacheManager.init(null, ([cachedFiles]) => {
|
||||
worker.cacheManager.init(([cachedFiles]) => {
|
||||
this.cachedFiles = new cc.AssetManager.Cache(cachedFiles);
|
||||
});
|
||||
},
|
||||
|
||||
clearCache() {
|
||||
worker.cacheManager.clearCache(null, () => {
|
||||
worker.cacheManager.clearCache(() => {
|
||||
this.cachedFiles.clear();
|
||||
});
|
||||
},
|
||||
|
||||
clearLRU() {
|
||||
worker.cacheManager.clearLRU(null, ([deletedFiles]) => {
|
||||
worker.cacheManager.clearLRU(([deletedFiles]) => {
|
||||
for (let i = 0, l = deletedFiles.length; i < l; i++) {
|
||||
this.cachedFiles.remove(deletedFiles[i]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user