Jelajahi Sumber

优化新手引导

zouyong 5 tahun lalu
induk
melakukan
e0a928b3df

+ 2 - 2
assets/resources/module/guide/guide.prefab

@@ -324,7 +324,7 @@
     ],
     "_spriteFrame": null,
     "_type": 0,
-    "_segments": 3100,
+    "_segments": 64,
     "_N$alphaThreshold": 0,
     "_N$inverted": true,
     "_id": ""
@@ -1164,7 +1164,7 @@
     "asset": {
       "__uuid__": "5f53c125-7a14-4ca0-986a-0e0d2d665268"
     },
-    "fileId": "5aaltp/CNENrilqsipfFxS",
+    "fileId": "735OBs8gpNxqHKVA7t6ETQ",
     "sync": false
   },
   {

+ 0 - 12
assets/resources/module/hotUpdate/perfab.meta

@@ -1,12 +0,0 @@
-{
-  "ver": "1.1.2",
-  "uuid": "efa349c9-0e27-4ce0-8e74-85e06375fc64",
-  "isBundle": false,
-  "bundleName": "",
-  "priority": 1,
-  "compressionType": {},
-  "optimizeHotUpdate": {},
-  "inlineSpriteFrames": {},
-  "isRemoteBundle": {},
-  "subMetas": {}
-}

+ 1 - 1
assets/script/before/GamePlay.ts

@@ -185,7 +185,7 @@ export default class GamePlay extends cc.Component {
             this.cellItemDic[0][3] && this.cellItemDic[0][3].onClick();
             this.cellItemDic[0][4] && this.cellItemDic[0][4].onClick();
         }
-        else if (data == "1_7") {//再点击一次增加大量进度哦
+        else if (data == "1_6") {//再点击一次增加大量进度哦
             this.cellItemDic[1][1] && this.cellItemDic[1][1].onClick();
             this.cellItemDic[1][2] && this.cellItemDic[1][2].onClick();
         }

+ 1 - 0
assets/script/game/data/module/GuideData.ts

@@ -42,6 +42,7 @@ export class GuideData {
             guide.click_rect = o.clickRect;
             guide.finger = o.finger;
             guide.lag_next = parseFloat(o.lagNext);
+            guide.display_type = parseInt(o.trNum);
             if (id != guide.id) {
                 this.data.set(id, arr);
                 arr = [];

+ 29 - 13
assets/script/game/module/guide/Guide.ts

@@ -61,6 +61,7 @@ export default class Guide extends cc.Component {
             this.close();
         }
         else {
+            this.node_display.getComponent(cc.Mask).type = this.crtGuide.display_type == 0 ? cc.Mask.Type.RECT : cc.Mask.Type.ELLIPSE;
             this.node_bg.opacity = 180;
             this.node_finger.opacity = 255;
             this.node_dialog.opacity = 255;
@@ -116,19 +117,32 @@ export default class Guide extends cc.Component {
 
             //显示区域由大到小动画
             if (x != null && y != null && w != null && h != null) {
-                //先重置
-                this.node_bg.x = this.node_bg.y = this.node_display.x = this.node_display.y = 0;
-                this.node_display.width = this.node.width;
-                this.node_display.height = this.node.height;
-                //动画
-                cc.tween(this.node_display)
-                    .to(0.3, { x: x, y: y, width: w, height: h }, {
-                        onUpdate: () => {
-                            this.node_bg.x = -this.node_display.x;
-                            this.node_bg.y = -this.node_display.y;
-                        }
-                    })
-                    .start();
+                if (this.crtGuide.display_type == 0) {//矩形选中框
+                    //先重置
+                    this.node_bg.x = this.node_bg.y = this.node_display.x = this.node_display.y = 0;
+                    this.node_display.width = this.node.width;
+                    this.node_display.height = this.node.height;
+                    //动画
+                    cc.tween(this.node_display)
+                        .to(0.3, { x: x, y: y, width: w, height: h }, {
+                            onUpdate: () => {
+                                this.node_bg.x = -this.node_display.x;
+                                this.node_bg.y = -this.node_display.y;
+                            }
+                        })
+                        .start();
+                }
+                else {
+                    //先重置
+                    this.node_bg.x = this.node_display.x = x;
+                    this.node_bg.y = this.node_display.y = y;
+                    this.node_display.width = this.node_display.height = this.node_bg.width = this.node_bg.height = this.node.height * 2;
+                    //动画
+                    let radius = this.crtGuide.display_type;
+                    cc.tween(this.node_display)
+                        .to(0.3, { width: radius, height: radius })
+                        .start();
+                }
             }
 
             //对话框位置
@@ -195,6 +209,8 @@ export default class Guide extends cc.Component {
     private reset() {
         this.node_display.width = 0;
         this.node_display.height = 0;
+        this.node_bg.width = this.node.width;
+        this.node_bg.height = this.node.height;
         this.node_bg.x = -this.node_display.x;
         this.node_bg.y = -this.node_display.y;
         this.node_bg.opacity = 0;

+ 2 - 0
assets/script/game/module/guide/GuideVO.ts

@@ -25,4 +25,6 @@ export default class GuideVO {
     finger: string;
     /** 下个时间 */
     lag_next: number;
+    /** 使用方形框还是圆角框 0方形框 1圆形框 */
+    display_type:number = 0;
 }