mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2024-12-25 11:18:30 +00:00
[engine] 高级性能指示器兼容不开启动态合图
This commit is contained in:
parent
53091170c4
commit
2faa6c31fd
@ -113,16 +113,19 @@ function generateStats () {
|
|||||||
|
|
||||||
},
|
},
|
||||||
human() {
|
human() {
|
||||||
const atlases = cc.dynamicAtlasManager.atlases;
|
if (cc.dynamicAtlasManager && cc.dynamicAtlasManager.enabled) {
|
||||||
const max = cc.dynamicAtlasManager.maxAtlasCount;
|
const max = cc.dynamicAtlasManager.maxAtlasCount;
|
||||||
const curLess = cc.dynamicAtlasManager.atlasCount;
|
const curLess = cc.dynamicAtlasManager.atlasCount;
|
||||||
const oneOfMax = cc.dynamicAtlasManager.textureSize * cc.dynamicAtlasManager.textureSize;
|
const oneOfMax = cc.dynamicAtlasManager.textureSize * cc.dynamicAtlasManager.textureSize;
|
||||||
let cur = 0;
|
let cur = 0;
|
||||||
for (const key in cc.dynamicAtlasManager.rects) {
|
for (const key in cc.dynamicAtlasManager.rects) {
|
||||||
const rect = cc.dynamicAtlasManager.rects[key];
|
const rect = cc.dynamicAtlasManager.rects[key];
|
||||||
cur += rect.sizes;
|
cur += rect.sizes;
|
||||||
|
}
|
||||||
|
return `${(cur / oneOfMax).toFixed(2)} / ${curLess} / ${max}`;
|
||||||
|
} else {
|
||||||
|
return 'disabled';
|
||||||
}
|
}
|
||||||
return `${(cur / oneOfMax).toFixed(2)} / ${curLess} / ${max}`;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user