Commit 3f11626d authored by 李维's avatar 李维

修复某些情况nativeUrl为undefined导致的异常

parent 666084cf
...@@ -227,10 +227,11 @@ export abstract class middleLayerBase extends cc.Component { ...@@ -227,10 +227,11 @@ export abstract class middleLayerBase extends cc.Component {
deepDrog(cc.find("Canvas")); deepDrog(cc.find("Canvas"));
// 释放远程加载的资源 // 释放远程加载的资源
cc.assetManager.assets.forEach(item => { cc.assetManager.assets.forEach(item => {
if( if (
item.nativeUrl.indexOf(`h5template`)==-1 item.nativeUrl &&
&& item.nativeUrl.indexOf(`dist`)==-1 item.nativeUrl.indexOf(`h5template`) == -1
&& item.nativeUrl.indexOf(`http`)>-1 && item.nativeUrl.indexOf(`dist`) == -1
&& item.nativeUrl.indexOf(`http`) > -1
) { ) {
cc.assetManager.releaseAsset(item); cc.assetManager.releaseAsset(item);
} }
......
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