Forráskód Böngészése

关闭子游戏使用destroy

zhaoyu_ma 2 hónapja
szülő
commit
76ee0a6c59

+ 1 - 1
luckypot_sp/assets/Lobby/scripts/BundleLoaderManager.js

@@ -274,7 +274,7 @@ class BundleLoaderManager {
                     }
                 bundle.preload(tempUrl, cc.Prefab, ()=>{
                 }, (err, prefab)=>{
-                    console.log('完成的kind: ', wKindID, err);
+                    console.log('完成的kind: ', wKindID);
                     if(wKindID == 3100 || wKindID == 3101){ //预加载完成后, 设置大厅按钮的spine动画.
                         EventMgr.getInstance().postEvent('setBtnBundle', {wKindID: wKindID});
                     }

+ 6 - 3
luckypot_sp/assets/Lobby/scripts/HNScenceManager.js

@@ -237,7 +237,8 @@ class HNScenceManager {
             }
             this.setHallNodesActive(false);
             if (this._currGameNode != undefined && this._currGameNode != null) {
-                this._currGameNode.removeFromParent(true);
+                this._currGameNode.destroy();
+                // this._currGameNode.removeFromParent(true);
                 this._currGameNode = null;
             }
             if (cc.vv && cc.vv.audioMgr) {
@@ -274,12 +275,14 @@ class HNScenceManager {
         cc.vv.audioMgr.stopBackMusic();
         cc.vv.audioMgr.stopAllEffects();
         if (this.pgContentP) {//销毁pg容器
-            this.pgContentP.removeFromParent(true);
+            this.pgContentP.destroy();
+            // this.pgContentP.removeFromParent(true);
             this.pgContentP = null;
         }
         if (this._currGameNode != undefined && this._currGameNode != null) {
 
-            this._currGameNode.removeFromParent(true);
+            this._currGameNode.destroy();
+            // this._currGameNode.removeFromParent(true);
             this._currGameNode = null;
 
             let runScene = cc.director.getScene();