فهرست منبع

补充棋盘动画

甘艺伟 9 ساعت پیش
والد
کامیت
f11ffe6ce4

+ 7 - 149
assets/bundle/gridMap/UECell.prefab

@@ -22,19 +22,16 @@
       },
       {
         "__id__": 7
-      },
-      {
-        "__id__": 11
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 14
+        "__id__": 10
       }
     ],
     "_prefab": {
-      "__id__": 15
+      "__id__": 11
     },
     "_opacity": 255,
     "_color": {
@@ -235,143 +232,6 @@
   },
   {
     "__type__": "cc.Node",
-    "_name": "node_select",
-    "_objFlags": 0,
-    "_parent": {
-      "__id__": 1
-    },
-    "_children": [],
-    "_active": false,
-    "_components": [
-      {
-        "__id__": 8
-      },
-      {
-        "__id__": 9
-      }
-    ],
-    "_prefab": {
-      "__id__": 10
-    },
-    "_opacity": 255,
-    "_color": {
-      "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
-      "a": 255
-    },
-    "_contentSize": {
-      "__type__": "cc.Size",
-      "width": 106,
-      "height": 106
-    },
-    "_anchorPoint": {
-      "__type__": "cc.Vec2",
-      "x": 0.5,
-      "y": 0.5
-    },
-    "_trs": {
-      "__type__": "TypedArray",
-      "ctor": "Float64Array",
-      "array": [
-        0,
-        0,
-        0,
-        0,
-        0,
-        0,
-        1,
-        1,
-        1,
-        1
-      ]
-    },
-    "_eulerAngles": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0,
-      "z": 0
-    },
-    "_skewX": 0,
-    "_skewY": 0,
-    "_is3DNode": false,
-    "_groupIndex": 0,
-    "groupIndex": 0,
-    "_id": ""
-  },
-  {
-    "__type__": "cc.Sprite",
-    "_name": "",
-    "_objFlags": 0,
-    "node": {
-      "__id__": 7
-    },
-    "_enabled": true,
-    "_materials": [
-      {
-        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
-      }
-    ],
-    "_srcBlendFactor": 770,
-    "_dstBlendFactor": 771,
-    "_spriteFrame": {
-      "__uuid__": "22088bb5-24b2-4f3f-83ee-cb7614f79972"
-    },
-    "_type": 0,
-    "_sizeMode": 2,
-    "_fillType": 0,
-    "_fillCenter": {
-      "__type__": "cc.Vec2",
-      "x": 0,
-      "y": 0
-    },
-    "_fillStart": 0,
-    "_fillRange": 0,
-    "_isTrimmedMode": false,
-    "_atlas": null,
-    "_id": ""
-  },
-  {
-    "__type__": "cc.Widget",
-    "_name": "",
-    "_objFlags": 0,
-    "node": {
-      "__id__": 7
-    },
-    "_enabled": true,
-    "alignMode": 1,
-    "_target": null,
-    "_alignFlags": 45,
-    "_left": -3,
-    "_right": -3,
-    "_top": -3,
-    "_bottom": -3,
-    "_verticalCenter": 0,
-    "_horizontalCenter": 0,
-    "_isAbsLeft": true,
-    "_isAbsRight": true,
-    "_isAbsTop": true,
-    "_isAbsBottom": true,
-    "_isAbsHorizontalCenter": true,
-    "_isAbsVerticalCenter": true,
-    "_originalWidth": 100,
-    "_originalHeight": 100,
-    "_id": ""
-  },
-  {
-    "__type__": "cc.PrefabInfo",
-    "root": {
-      "__id__": 1
-    },
-    "asset": {
-      "__id__": 0
-    },
-    "fileId": "ffja8R3E1Fb44QVEsk6YdQ",
-    "sync": false
-  },
-  {
-    "__type__": "cc.Node",
     "_name": "node_lock",
     "_objFlags": 0,
     "_parent": {
@@ -381,11 +241,11 @@
     "_active": false,
     "_components": [
       {
-        "__id__": 12
+        "__id__": 8
       }
     ],
     "_prefab": {
-      "__id__": 13
+      "__id__": 9
     },
     "_opacity": 255,
     "_color": {
@@ -439,7 +299,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 11
+      "__id__": 7
     },
     "_enabled": true,
     "_materials": [
@@ -485,14 +345,12 @@
       "__id__": 1
     },
     "_enabled": true,
-    "node_select": {
-      "__id__": 7
-    },
+    "node_select": null,
     "sp_quality": {
       "__id__": 5
     },
     "node_lock": {
-      "__id__": 11
+      "__id__": 7
     },
     "cubePrefab": {
       "__uuid__": "b1448898-31aa-41e2-82e6-34d02a326bd0"

+ 141 - 0
assets/bundle/gridMap/UECellSelect.prefab

@@ -0,0 +1,141 @@
+[
+  {
+    "__type__": "cc.Prefab",
+    "_name": "",
+    "_objFlags": 0,
+    "_native": "",
+    "data": {
+      "__id__": 1
+    },
+    "optimizationPolicy": 0,
+    "asyncLoadAssets": false,
+    "readonly": false
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "node_select",
+    "_objFlags": 0,
+    "_parent": null,
+    "_children": [],
+    "_active": false,
+    "_components": [
+      {
+        "__id__": 2
+      },
+      {
+        "__id__": 3
+      }
+    ],
+    "_prefab": {
+      "__id__": 4
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 106,
+      "height": 106
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        1,
+        1,
+        1,
+        1
+      ]
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "_materials": [
+      {
+        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+      }
+    ],
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
+    "_spriteFrame": {
+      "__uuid__": "22088bb5-24b2-4f3f-83ee-cb7614f79972"
+    },
+    "_type": 0,
+    "_sizeMode": 2,
+    "_fillType": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": false,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Animation",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "_defaultClip": {
+      "__uuid__": "6829f34e-80c1-4dc8-85ce-8ba666f3e8fa"
+    },
+    "_clips": [
+      {
+        "__uuid__": "6829f34e-80c1-4dc8-85ce-8ba666f3e8fa"
+      }
+    ],
+    "playOnLoad": true,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "",
+    "sync": false
+  }
+]

+ 9 - 0
assets/bundle/gridMap/UECellSelect.prefab.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.3.2",
+  "uuid": "fc915806-8057-4e3d-910d-a0b105b5d773",
+  "importer": "prefab",
+  "optimizationPolicy": "AUTO",
+  "asyncLoadAssets": false,
+  "readonly": false,
+  "subMetas": {}
+}

+ 1 - 0
assets/bundle/gridMap/UECube.prefab

@@ -982,6 +982,7 @@
     "node_emitter_num": {
       "__id__": 20
     },
+    "node_select": null,
     "_id": ""
   },
   {

+ 3 - 0
assets/bundle/gridMap/UEGridMap.prefab

@@ -595,6 +595,9 @@
     "cubePrefab": {
       "__uuid__": "b1448898-31aa-41e2-82e6-34d02a326bd0"
     },
+    "cellSelectPrefab": {
+      "__uuid__": "fc915806-8057-4e3d-910d-a0b105b5d773"
+    },
     "gridLayer": {
       "__id__": 3
     },

+ 13 - 0
assets/bundle/gridMap/animation.meta

@@ -0,0 +1,13 @@
+{
+  "ver": "1.1.3",
+  "uuid": "ce6fb660-beac-4bec-a03a-b0b596f55909",
+  "importer": "folder",
+  "isBundle": false,
+  "bundleName": "",
+  "priority": 1,
+  "compressionType": {},
+  "optimizeHotUpdate": {},
+  "inlineSpriteFrames": {},
+  "isRemoteBundle": {},
+  "subMetas": {}
+}

+ 71 - 0
assets/bundle/gridMap/animation/select_anim.anim

@@ -0,0 +1,71 @@
+{
+  "__type__": "cc.AnimationClip",
+  "_name": "select_anim",
+  "_objFlags": 0,
+  "_native": "",
+  "_duration": 2.6166666666666667,
+  "sample": 60,
+  "speed": 1,
+  "wrapMode": 2,
+  "curveData": {
+    "props": {
+      "scale": [
+        {
+          "frame": 0,
+          "value": {
+            "__type__": "cc.Vec3",
+            "x": 1,
+            "y": 1,
+            "z": 1
+          }
+        },
+        {
+          "frame": 1.8333333333333333,
+          "value": {
+            "__type__": "cc.Vec3",
+            "x": 1,
+            "y": 1,
+            "z": 1
+          }
+        },
+        {
+          "frame": 2.2333333333333334,
+          "value": {
+            "__type__": "cc.Vec3",
+            "x": 1.3,
+            "y": 1.3,
+            "z": 1
+          }
+        },
+        {
+          "frame": 2.4166666666666665,
+          "value": {
+            "__type__": "cc.Vec3",
+            "x": 1,
+            "y": 1,
+            "z": 1
+          }
+        },
+        {
+          "frame": 2.533333333333333,
+          "value": {
+            "__type__": "cc.Vec3",
+            "x": 1.15,
+            "y": 1.15,
+            "z": 1
+          }
+        },
+        {
+          "frame": 2.6166666666666667,
+          "value": {
+            "__type__": "cc.Vec3",
+            "x": 1,
+            "y": 1,
+            "z": 1
+          }
+        }
+      ]
+    }
+  },
+  "events": []
+}

+ 6 - 0
assets/bundle/gridMap/animation/select_anim.anim.meta

@@ -0,0 +1,6 @@
+{
+  "ver": "2.1.2",
+  "uuid": "6829f34e-80c1-4dc8-85ce-8ba666f3e8fa",
+  "importer": "animation-clip",
+  "subMetas": {}
+}

+ 2 - 15
assets/script/logic/gridMap/UECell.ts

@@ -22,8 +22,7 @@ export default class UECell extends UEBase {
     static readonly PrefabUrl: string = "UECell";
     static readonly CLS: string = "UECell";
 
-    @property(cc.Node)
-    private node_select: cc.Node = null!;
+
     @property(ResSprite)
     private sp_quality: ResSprite = null;
     @property(cc.Node)
@@ -37,17 +36,9 @@ export default class UECell extends UEBase {
         this.node.zIndex = cellData.idx;
         this.SetLock();
         EventMng.on(GridEvent.HC_CELL_CHANGE, this.OnHcCellChange, this);
-        EventMng.on(GridEvent.HC_CELL_SELECT, this.OnHcCellSelect, this);
     }
 
-    /** 监听格子选中 */
-    OnHcCellSelect(idx: number) {
-        if (!idx) {
-            this.SetSelect(false);
-        } else if (idx == this.cellData.idx) {
-            this.SetSelect(true);
-        }
-    }
+
 
     /** 监听格子变化 */
     OnHcCellChange(data: { idx: number, item: HcInfoGeziInfo }) {
@@ -124,10 +115,6 @@ export default class UECell extends UEBase {
     }
 
 
-    SetSelect(isSelect: boolean) {
-        this.node_select.active = isSelect;
-    }
-
     /** 是否有物品可以拖动 */
     CanDrag(): boolean {
         return !this.IsEmpty() && this.ueCube.CanDrag() && !this.IsLock();

+ 4 - 4
assets/script/logic/gridMap/UECube.ts

@@ -34,7 +34,6 @@ export default class UECube extends UEBase {
     private sp_item: ResSprite = null!;
     @property(cc.Node)
     private node_emitter_num: cc.Node = null!;
-
     cubeData: I_CubeData = null!;
     quality: number = 0;
     ueHomeRole: UEHomeRole = null!;
@@ -137,9 +136,10 @@ export default class UECube extends UEBase {
     /** 播放果冻效果 */
     PlayJellyAnim() {
         cc.tween(this.itemNode)
-            .to(0.1, { scale: 1.3 })
-            .to(0.1, { scale: 0.9 })
-            .to(0.08, { scale: 1 })
+            .to(0.24, { scale: 1.3, easing: 'quadOut' })
+            .to(0.12, { scale: 0.85, easing: 'quadIn' })
+            .to(0.1, { scale: 1.1, easing: 'quadOut' })
+            .to(0.08, { scale: 1, easing: 'quadInOut' })
             .start();
     }
 

+ 17 - 0
assets/script/logic/gridMap/UEGridMap.ts

@@ -26,6 +26,8 @@ export default class UEGridMap extends UEBase {
     cellPrefab: cc.Prefab = null!;
     @property(cc.Prefab)
     cubePrefab: cc.Prefab = null!;
+    @property(cc.Prefab)
+    cellSelectPrefab: cc.Prefab = null!;
     @property(cc.Node)
     gridLayer: cc.Node = null;
     @property(cc.Node)
@@ -43,10 +45,14 @@ export default class UEGridMap extends UEBase {
     private lastMoveCell: UECell = null!;
     private clickCnt: number = 0;
     private ueMergeTip: UEMergeTip;
+    private cellSelect: cc.Node = null!;
     Init() {
         this.ueMergeTip = AssetMgr.instantiateUE(UEMergeTip);
         this.tipLayer.addChild(this.ueMergeTip.node);
         this.ueMergeTip.node.active = false;
+        this.cellSelect = cc.instantiate(this.cellSelectPrefab);
+        this.tipLayer.addChild(this.cellSelect);
+        this.cellSelect.active = false;
         GameDataCenter.gridMap.Init(this);
         this.gridLayer.setContentSize(GridConstant.CELL_WIDTH * GridConstant.ROW, GridConstant.CELL_WIDTH * GridConstant.COL);
         // 计算缩放比例
@@ -72,12 +78,23 @@ export default class UEGridMap extends UEBase {
         this.initEvent(GridEvent.HC_INFO_RSP, this.LoadMapData);
         this.initEvent(GridEvent.HC_MERGE_RSP, this.OnHcMergeRsp);
         this.initEvent(GridEvent.HC_FIGHT_OVER, this.OnHcFightOver);
+        this.initEvent(GridEvent.HC_CELL_SELECT, this.OnHcCellSelect);
     }
 
     public GetCubeLayer() {
         return this.cubeLayer;
     }
 
+    /** 监听格子选中 */
+    private OnHcCellSelect(idx: number) {
+        if (!idx) {
+            this.cellSelect.active = false;
+        } else {
+            this.cellSelect.active = true;
+            this.cellSelect.setPosition(GameDataCenter.gridMap.GetPosByIdx(idx));
+        }
+    }
+
 
 
     /** 加载地图数据 */