[LayaAir 2.0]3d资源无法写入缓存
load 3d资源 没有写入缓存 没走
MiniFileMgr.onSaveFile=function(readyUrl,md5Name,isAdd,encoding,callBack,fileSize){
(isAdd===void 0)&& (isAdd=true);
(encoding===void 0)&& (encoding="");
(fileSize===void 0)&& (fileSize=0);
var fileurlkey=readyUrl;
if(MiniFileMgr.filesListObj['fileUsedSize']==null)
MiniFileMgr.filesListObj['fileUsedSize']=0;
if(isAdd){
var fileNativeName=MiniFileMgr.getFileNativePath(md5Name);
MiniFileMgr.filesListObj[fileurlkey]={md5:md5Name,readyUrl:readyUrl,size:fileSize,times:Browser.now(),encoding:encoding};
MiniFileMgr.filesListObj['fileUsedSize']=parseInt(MiniFileMgr.filesListObj['fileUsedSize'])+fileSize;
MiniFileMgr.writeFilesList(fileurlkey,JSON.stringify(MiniFileMgr.filesListObj),true);
callBack !=null && callBack.runWith([0]);
}else{
if(MiniFileMgr.filesListObj[fileurlkey]){
var deletefileSize=parseInt(MiniFileMgr.filesListObj[fileurlkey].size);
MiniFileMgr.filesListObj['fileUsedSize']=parseInt(MiniFileMgr.filesListObj['fileUsedSize'])-deletefileSize;
delete MiniFileMgr.filesListObj[fileurlkey];
MiniFileMgr.writeFilesList(fileurlkey,JSON.stringify(MiniFileMgr.filesListObj),false);
callBack !=null && callBack.runWith([0]);
}
}
}
MiniFileMgr.onSaveFile=function(readyUrl,md5Name,isAdd,encoding,callBack,fileSize){
(isAdd===void 0)&& (isAdd=true);
(encoding===void 0)&& (encoding="");
(fileSize===void 0)&& (fileSize=0);
var fileurlkey=readyUrl;
if(MiniFileMgr.filesListObj['fileUsedSize']==null)
MiniFileMgr.filesListObj['fileUsedSize']=0;
if(isAdd){
var fileNativeName=MiniFileMgr.getFileNativePath(md5Name);
MiniFileMgr.filesListObj[fileurlkey]={md5:md5Name,readyUrl:readyUrl,size:fileSize,times:Browser.now(),encoding:encoding};
MiniFileMgr.filesListObj['fileUsedSize']=parseInt(MiniFileMgr.filesListObj['fileUsedSize'])+fileSize;
MiniFileMgr.writeFilesList(fileurlkey,JSON.stringify(MiniFileMgr.filesListObj),true);
callBack !=null && callBack.runWith([0]);
}else{
if(MiniFileMgr.filesListObj[fileurlkey]){
var deletefileSize=parseInt(MiniFileMgr.filesListObj[fileurlkey].size);
MiniFileMgr.filesListObj['fileUsedSize']=parseInt(MiniFileMgr.filesListObj['fileUsedSize'])-deletefileSize;
delete MiniFileMgr.filesListObj[fileurlkey];
MiniFileMgr.writeFilesList(fileurlkey,JSON.stringify(MiniFileMgr.filesListObj),false);
callBack !=null && callBack.runWith([0]);
}
}
}
没有找到相关结果
已邀请:
要回复问题请先登录
2 个回复
ZX
赞同来自:
Aar0n
赞同来自: