Commit 9b303537 authored by liujiaxin's avatar liujiaxin

123

parent 63020a6e
...@@ -236,13 +236,13 @@ export default class PengPeng extends cc.Component { ...@@ -236,13 +236,13 @@ export default class PengPeng extends cc.Component {
// dragonDisplay.dragonAtlasAsset.destroy(); // dragonDisplay.dragonAtlasAsset.destroy();
// dragonDisplay.dragonAsset.destroy(); // dragonDisplay.dragonAsset.destroy();
if (u1 && u1.startsWith('http')) { if (u1 && typeof u1 == 'string' && u1.startsWith('http')) {
console.log('release1', u1) console.log('release1', u1)
dragonDisplay.dragonAtlasAsset.destroy(); dragonDisplay.dragonAtlasAsset.destroy();
cc.assetManager.releaseAsset(dragonDisplay.dragonAtlasAsset.texture); cc.assetManager.releaseAsset(dragonDisplay.dragonAtlasAsset.texture);
cc.assetManager.releaseAsset(u1); cc.assetManager.releaseAsset(u1);
} }
if (u2 && u2.startsWith('http')) { if (u2 && typeof u2 == 'string' && u2.startsWith('http')) {
console.log('release1', u2) console.log('release1', u2)
dragonDisplay.dragonAsset.destroy(); dragonDisplay.dragonAsset.destroy();
cc.assetManager.releaseAsset(u2); cc.assetManager.releaseAsset(u2);
......
...@@ -322,7 +322,7 @@ let pg = { ...@@ -322,7 +322,7 @@ let pg = {
// if (err && !texture) return resolve(pg.logger.w('loading loadNetImg warn-> ' + texture)); // if (err && !texture) return resolve(pg.logger.w('loading loadNetImg warn-> ' + texture));
// resolve(texture); // resolve(texture);
// }); // });
if (url.startsWith('http')) { if (url && typeof url == 'string' && url.startsWith('http')) {
cc.assetManager.loadRemote(url, (err, texture) => { cc.assetManager.loadRemote(url, (err, texture) => {
if (err && !texture) return resolve(pg.logger.w('loading loadNetImg warn-> ' + texture)); if (err && !texture) return resolve(pg.logger.w('loading loadNetImg warn-> ' + texture));
resolve(texture); resolve(texture);
...@@ -347,7 +347,7 @@ let pg = { ...@@ -347,7 +347,7 @@ let pg = {
resolve(url); resolve(url);
} }
if (!option || Object.keys(option).length == 0) option = {type: cc.Texture2D}; if (!option || Object.keys(option).length == 0) option = {type: cc.Texture2D};
if (url.startsWith('http')) { if (url && typeof url == 'string' && url.startsWith('http')) {
cc.assetManager.loadRemote(url,option, (err, texture) => { cc.assetManager.loadRemote(url,option, (err, texture) => {
if (err && !texture) return reject(pg.logger.w('loading loadNetImg warn-> ' + texture)); if (err && !texture) return reject(pg.logger.w('loading loadNetImg warn-> ' + texture));
resolve(texture); resolve(texture);
......
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