Explorar o código

pg容器优化

lhj hai 4 meses
pai
achega
e65442e9ee
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      luckypot_sp/assets/Lobby/scripts/HNScenceManager.js

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

@@ -218,11 +218,11 @@ class HNScenceManager {
                     pgContentP = this.pgContentP
                 }else{
                     pgContentP = this.pgContentP = new cc.Node("pgContentP")
+                    runScene.addChild(pgContentP);
                 }
                 pgContentP.angle = 90
                 pgContentP.setContentSize(runScene.getContentSize().height,runScene.getContentSize().width)//因为旋转了,宽高对调了
                 gameNode.parent = pgContentP
-                runScene.addChild(pgContentP);
                 pgContentP.setAnchorPoint(0.5, 0.5);
                 pgContentP.setPosition(cc.v2(0,0))
                 // let widget = pgContentP.addComponent(cc.Widget);
@@ -276,8 +276,8 @@ class HNScenceManager {
         cc.vv.audioMgr.stopAllEffects();
         if (this.pgContentP) {//销毁pg容器
             // this.pgContentP.destroy();
-            this.pgContentP.removeFromParent(true);
-            this.pgContentP = null;
+            // this.pgContentP.removeFromParent(true);
+            // this.pgContentP = null;
         }
         if (this._currGameNode != undefined && this._currGameNode != null) {