Commit 79977a85 authored by liujiangnan's avatar liujiangnan

debug

parent 449fbcd7
......@@ -189,3 +189,24 @@ export function initAir(_this) {
};
}
export function timerManager () {
window.timerManager = {};
for(let i=0;i<20;i++){
window.timerManager[`timer${i}`] = {
handler: null,
type: null,
};
}
return {
freeAll() {
for (const key in window.timerManager) {
const obj = window.timerManager[key];
if(obj.handler){
window[type](obj.handler);
}
}
}
}
}
import { initAir } from './air';
import { initAir, timerManager } from './air';
cc.Class({
extends: cc.Component,
properties: {
......@@ -44,10 +44,13 @@ cc.Class({
// 统计已加载的数量
loadedCount: null,
// 统一释放异步资源的方法
freeAll: null,
onLoad() {
this.preloadCount = 0;
this.loadedCount = 0;
initAir(this);
this.freeAll = timerManager().freeAll;
// this.preloadAll();
},
......@@ -218,7 +221,7 @@ cc.Class({
.call(() => {
exitBtn.active = false;
cc.game.removePersistRootNode(this.node);
this.node.destory();
this.freeAll();
cc.director.loadScene("debug_shell", () => {
});
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment