Commit aed34cf9 authored by liujiangnan's avatar liujiangnan

debug

parent 7d614709
......@@ -189,36 +189,3 @@ export function initAir(_this) {
};
}
export function timerManager () {
window.timerManager = {};
for(let i=0;i<20;i++){
window.timerManager[`timer${i}`] = {
handler: null,
type: null,
};
}
window.freeAllTimeInterval = function(){
console.log("===liu===des==freeAll");
for (const key in window.timerManager) {
const obj = window.timerManager[key];
console.log("===liu===des==",obj.handler, obj.type);
if(obj.handler){
window[obj.type](obj.handler);
}
}
}
return {
freeAll() {
console.log("===liu=====freeAll");
for (const key in window.timerManager) {
const obj = window.timerManager[key];
console.log("===liu=====",obj.handler, obj.type);
if(obj.handler){
window[obj.type](obj.handler);
}
}
}
}
}
import { initAir, timerManager } from './air';
import { initAir } from './air';
cc.Class({
extends: cc.Component,
properties: {
......@@ -45,12 +45,10 @@ cc.Class({
loadedCount: null,
// 统一释放异步资源的方法
freeAll: null,
onLoad() {
this.preloadCount = 0;
this.loadedCount = 0;
initAir(this);
this.freeAll = timerManager().freeAll;
// this.preloadAll();
},
......@@ -137,7 +135,6 @@ cc.Class({
cc.assetManager.loadBundle(scene.bondleUrl, { version: scene.version }, (err, bundle) => {
console.log(`${scene.bondleUrl}---场景开始loadBundle----`);
if (!bundle) {
console.log("=====liu=======", JSON.stringify(err));
_this.loadedCount++;
_this.updateProcessBar();
i++;
......@@ -222,9 +219,6 @@ cc.Class({
.call(() => {
exitBtn.active = false;
cc.game.removePersistRootNode(this.node);
console.log("======mid========");
this.freeAll();
console.log("======mid1========");
cc.director.getScene().destroy();
cc.director.loadScene("debug_shell", null, null, (err, scene) => {
......
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