|
@@ -199,7 +199,12 @@ class HNScenceManager {
|
|
|
bundle.load(url, cc.Prefab, () => {
|
|
|
// this.loadBundleProgress();
|
|
|
}, (err, prefab) => {
|
|
|
- Global.print("创建游戏节点 strPrefabs = " + prefab);
|
|
|
+ if(err){
|
|
|
+ console.log('cuowu: ', err);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log("创建游戏节点 strPrefabs = " , prefab);
|
|
|
UIHelper.hideWaitNode();
|
|
|
UIHelper.hideAMask();
|
|
|
let gameNode = null;
|
|
@@ -237,8 +242,8 @@ class HNScenceManager {
|
|
|
}
|
|
|
this.setHallNodesActive(false);
|
|
|
if (this._currGameNode != undefined && this._currGameNode != null) {
|
|
|
- // this._currGameNode.destroy();
|
|
|
- this._currGameNode.removeFromParent(true);
|
|
|
+ this._currGameNode.destroy();
|
|
|
+ // this._currGameNode.removeFromParent(true);
|
|
|
this._currGameNode = null;
|
|
|
}
|
|
|
if (cc.vv && cc.vv.audioMgr) {
|
|
@@ -271,9 +276,21 @@ class HNScenceManager {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+ removeSelectBundle(){
|
|
|
+ let curKind = cc.vv.serverListData.getCurRoomData().KindID;
|
|
|
+ let config = BundleLoaderManager.Instance().bundleBaseData;
|
|
|
+ for(let key in config){
|
|
|
+ if(key == curKind){
|
|
|
+ return config[key].bundle;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
gameBackScence() {
|
|
|
cc.vv.audioMgr.stopBackMusic();
|
|
|
cc.vv.audioMgr.stopAllEffects();
|
|
|
+
|
|
|
if (this.pgContentP) {//销毁pg容器
|
|
|
// this.pgContentP.destroy();
|
|
|
// this.pgContentP.removeFromParent(true);
|
|
@@ -281,8 +298,21 @@ class HNScenceManager {
|
|
|
}
|
|
|
if (this._currGameNode != undefined && this._currGameNode != null) {
|
|
|
|
|
|
- // this._currGameNode.destroy();
|
|
|
- this._currGameNode.removeFromParent(true);
|
|
|
+ this._currGameNode.destroy();
|
|
|
+ // this._currGameNode.removeFromParent(true);
|
|
|
+
|
|
|
+
|
|
|
+ //移除bundle
|
|
|
+ let tName =this.removeSelectBundle();
|
|
|
+ let bundle = cc.assetManager.getBundle(tName);
|
|
|
+ if(bundle){
|
|
|
+ setTimeout(()=>{
|
|
|
+ window.nowBundle = null;
|
|
|
+ bundle.releaseAll();
|
|
|
+ cc.assetManager.removeBundle(bundle);
|
|
|
+ }, 100)
|
|
|
+ }
|
|
|
+
|
|
|
this._currGameNode = null;
|
|
|
|
|
|
let runScene = cc.director.getScene();
|