Commit 0005334d authored by liujiangnan's avatar liujiangnan

debug

parent d8cfefff
......@@ -210,7 +210,10 @@ export abstract class middleLayerBase extends cc.Component {
this.loadBundle(sceneName, version, bondleUrl);
}
cleanMemory() {
cleanMemory(currentScene) {
if (!this.oldSceneName || this.oldSceneName == currentScene) {
return;
}
// 释放骨骼动画
const deepDrog = (nd) => {
const dragonDisplay = nd.getComponent(dragonBones.ArmatureDisplay);
......@@ -223,12 +226,16 @@ export abstract class middleLayerBase extends cc.Component {
}
deepDrog(cc.find("Canvas"));
// 释放bundle
const bd = cc.assetManager.getBundle(this.oldSceneName);
bd.releaseAll();
cc.assetManager.removeBundle(bd);
// const bd = cc.assetManager.getBundle(this.oldSceneName);
// bd.releaseAll();
// cc.assetManager.removeBundle(bd);
// 释放远程加载的资源
cc.assetManager.assets.forEach(item => {
if(item.nativeUrl.indexOf(`h5template`)==-1 && item.nativeUrl.indexOf(`dist`)==-1 && item.nativeUrl.indexOf(`http`)>-1) {
if(
item.nativeUrl.indexOf(`h5template`)==-1
&& item.nativeUrl.indexOf(`dist`)==-1
&& item.nativeUrl.indexOf(`http`)>-1
) {
cc.assetManager.releaseAsset(item);
}
});
......@@ -244,7 +251,7 @@ export abstract class middleLayerBase extends cc.Component {
this.currentBundleInfo = { sceneName, version, bondleUrl };
this.showWaitingLetters();
cc.audioEngine.stopAll();
this.cleanMemory();
this.cleanMemory(sceneName);
cc.assetManager.loadBundle(bondleUrl, { version: version }, async (err, bundle) => {
bundle.loadScene(sceneName, null, (finish, total, item) => {
this.setLoadingProgressBar(Math.floor(finish / total * 100));
......
{
"ver": "2.3.5",
"uuid": "ab2d62be-6f3d-423a-88e7-d7305a5ffb69",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 2,
"height": 2,
"platformSettings": {},
"subMetas": {
"smbg": {
"ver": "1.0.4",
"uuid": "765dfc93-79dd-444d-bcac-3b0f64e55678",
"rawTextureUuid": "ab2d62be-6f3d-423a-88e7-d7305a5ffb69",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 2,
"height": 2,
"rawWidth": 2,
"rawHeight": 2,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
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