Bladeren bron

优化新手引导

zouyong 5 jaren geleden
bovenliggende
commit
4ca00c4659
1 gewijzigde bestanden met toevoegingen van 8 en 3 verwijderingen
  1. 8 3
      assets/script/game/module/guide/Guide.ts

+ 8 - 3
assets/script/game/module/guide/Guide.ts

@@ -45,6 +45,7 @@ export default class Guide extends cc.Component {
             this.node.destroy();
             this.node.destroy();
             return;
             return;
         }
         }
+        this.reset();
         this.guides = gData.guideData.getGuidesByID(gData.guideData.crtID);
         this.guides = gData.guideData.getGuidesByID(gData.guideData.crtID);
         this.crtStep = -1;
         this.crtStep = -1;
         this.nextStep();
         this.nextStep();
@@ -124,7 +125,7 @@ export default class Guide extends cc.Component {
                     this.node_display.height = this.node.height;
                     this.node_display.height = this.node.height;
                     //动画
                     //动画
                     cc.tween(this.node_display)
                     cc.tween(this.node_display)
-                        .to(0.1, { x: x, y: y, width: w, height: h }, {
+                        .to(0.2, { x: x, y: y, width: w, height: h }, {
                             onUpdate: () => {
                             onUpdate: () => {
                                 this.node_bg.x = -this.node_display.x;
                                 this.node_bg.x = -this.node_display.x;
                                 this.node_bg.y = -this.node_display.y;
                                 this.node_bg.y = -this.node_display.y;
@@ -140,13 +141,13 @@ export default class Guide extends cc.Component {
                     //动画
                     //动画
                     let radius = this.crtGuide.display_type;
                     let radius = this.crtGuide.display_type;
                     cc.tween(this.node_display)
                     cc.tween(this.node_display)
-                        .to(0.1, { width: radius, height: radius })
+                        .to(0.2, { width: radius, height: radius })
                         .start();
                         .start();
                 }
                 }
             }
             }
 
 
             //对话框位置
             //对话框位置
-            ////全屏对齐
+            //全屏对齐
             if (this.crtGuide.dialog_pos != null && this.crtGuide.dialog_pos.length > 0) {
             if (this.crtGuide.dialog_pos != null && this.crtGuide.dialog_pos.length > 0) {
                 let arr = this.crtGuide.dialog_pos.split(":");
                 let arr = this.crtGuide.dialog_pos.split(":");
                 let wedgit = this.node_dialog.getComponent(cc.Widget);
                 let wedgit = this.node_dialog.getComponent(cc.Widget);
@@ -156,6 +157,10 @@ export default class Guide extends cc.Component {
             }
             }
             else {//显示区域偏移
             else {//显示区域偏移
                 let arr = this.crtGuide.dialog_pos1.split(",");
                 let arr = this.crtGuide.dialog_pos1.split(",");
+                let wedgit = this.node_dialog.getComponent(cc.Widget);
+                for (let i = 0; i < this.widgets.length; i++) {
+                    wedgit[this.widgets[i]] = null;
+                }
                 this.node_dialog.x = x + parseInt(arr[0]);
                 this.node_dialog.x = x + parseInt(arr[0]);
                 this.node_dialog.y = y + parseInt(arr[1]);
                 this.node_dialog.y = y + parseInt(arr[1]);
             }
             }