甘艺伟 il y a 1 semaine
Parent
commit
65ae2abaa6

BIN
assets/bundle/FGUI/Home/Home.bin


+ 11 - 121
assets/bundle/gridMap/UEGridMap.prefab

@@ -19,22 +19,19 @@
     "_children": [
       {
         "__id__": 2
-      },
-      {
-        "__id__": 5
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 10
+        "__id__": 7
       },
       {
-        "__id__": 11
+        "__id__": 8
       }
     ],
     "_prefab": {
-      "__id__": 12
+      "__id__": 9
     },
     "_opacity": 255,
     "_color": {
@@ -85,113 +82,6 @@
   },
   {
     "__type__": "cc.Node",
-    "_name": "bg",
-    "_objFlags": 0,
-    "_parent": {
-      "__id__": 1
-    },
-    "_children": [],
-    "_active": true,
-    "_components": [
-      {
-        "__id__": 3
-      }
-    ],
-    "_prefab": {
-      "__id__": 4
-    },
-    "_opacity": 255,
-    "_color": {
-      "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
-      "a": 255
-    },
-    "_contentSize": {
-      "__type__": "cc.Size",
-      "width": 728,
-      "height": 1422
-    },
-    "_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__": 2
-    },
-    "_enabled": true,
-    "_materials": [
-      {
-        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
-      }
-    ],
-    "_srcBlendFactor": 770,
-    "_dstBlendFactor": 771,
-    "_spriteFrame": {
-      "__uuid__": "745e7674-2464-4d94-bc20-c61fb04473f1"
-    },
-    "_type": 0,
-    "_sizeMode": 1,
-    "_fillType": 0,
-    "_fillCenter": {
-      "__type__": "cc.Vec2",
-      "x": 0,
-      "y": 0
-    },
-    "_fillStart": 0,
-    "_fillRange": 0,
-    "_isTrimmedMode": true,
-    "_atlas": null,
-    "_id": ""
-  },
-  {
-    "__type__": "cc.PrefabInfo",
-    "root": {
-      "__id__": 1
-    },
-    "asset": {
-      "__id__": 0
-    },
-    "fileId": "50r/f+hahAqrXoS4uVPxgd",
-    "sync": false
-  },
-  {
-    "__type__": "cc.Node",
     "_name": "gridCenter",
     "_objFlags": 0,
     "_parent": {
@@ -199,17 +89,17 @@
     },
     "_children": [
       {
-        "__id__": 6
+        "__id__": 3
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 8
+        "__id__": 5
       }
     ],
     "_prefab": {
-      "__id__": 9
+      "__id__": 6
     },
     "_opacity": 255,
     "_color": {
@@ -263,13 +153,13 @@
     "_name": "gridLayer",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 5
+      "__id__": 2
     },
     "_children": [],
     "_active": true,
     "_components": [],
     "_prefab": {
-      "__id__": 7
+      "__id__": 4
     },
     "_opacity": 255,
     "_color": {
@@ -334,7 +224,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 5
+      "__id__": 2
     },
     "_enabled": true,
     "alignMode": 1,
@@ -406,10 +296,10 @@
       "__uuid__": "b8920836-86d2-466d-951c-df24fe0d55c0"
     },
     "gridCenter": {
-      "__id__": 5
+      "__id__": 2
     },
     "gridLayer": {
-      "__id__": 6
+      "__id__": 3
     },
     "_id": ""
   },

+ 6 - 0
assets/script/logic/fgui/Home/Home/HomeCtrl.ts

@@ -8,6 +8,7 @@
 import GameDataCenter from "../../../../data/GameDataCenter";
 import { ViewZOrder } from "../../../../data/const/ViewZOrder";
 import { ResCollector } from "../../../../frameWork/compment/ResCollector";
+import ResSprite from "../../../../frameWork/compment/ResSprite";
 import FguiMgr from "../../../../frameWork/fgui/FguiMgr";
 import { FguiViewCtrl } from "../../../../frameWork/fgui/mvc/FguiViewCtrl";
 import { GameServerConfig } from "../../../../network/GameServerConfig";
@@ -39,6 +40,11 @@ export class HomeCtrl extends FguiViewCtrl<HomeVM> {
         } else {
             console.log('失败');
         }
+        let bgResSprite = this.VM.BgRoot.node.getComponent(ResSprite);
+        if (!bgResSprite) {
+            bgResSprite = this.VM.BgRoot.node.addComponent(ResSprite);
+        }
+        bgResSprite.setSpriteFrame('gridMap', 'mapBgs/imgBg');
     }
 
 

+ 10 - 8
assets/script/logic/fgui/Home/Home/HomeVM.ts

@@ -9,10 +9,7 @@ import { FguiViewModel } from "../../../../frameWork/fgui/mvc/FguiViewModel";
 
 export class HomeVM extends FguiViewModel {
 
-    readonly GridRoot: fgui.GComponent;
-    readonly HdList: fgui.GList;
-    readonly HeadTopCom: fgui.GComponent;
-    readonly Top: fgui.GGroup;
+    readonly BgRoot: fgui.GComponent;
     readonly EquipCom1: fgui.GComponent;
     readonly EquipCom2: fgui.GComponent;
     readonly EquipCom3: fgui.GComponent;
@@ -34,13 +31,14 @@ export class HomeVM extends FguiViewModel {
     readonly BtnClub: fgui.GButton;
     readonly BtnPlays: fgui.GButton;
     readonly Bottom: fgui.GGroup;
+    readonly GridRoot: fgui.GComponent;
+    readonly HdList: fgui.GList;
+    readonly HeadTopCom: fgui.GComponent;
+    readonly Top: fgui.GGroup;
 
     constructor(panel: fgui.GComponent) {
         super(panel);
-        this.GridRoot = panel.getChild("gridRoot") as fgui.GComponent;
-        this.HdList = panel.getChild("hdList") as fgui.GList;
-        this.HeadTopCom = panel.getChild("HeadTopCom") as fgui.GComponent;
-        this.Top = panel.getChild("top") as fgui.GGroup;
+        this.BgRoot = panel.getChild("bgRoot") as fgui.GComponent;
         this.EquipCom1 = panel.getChild("EquipCom1") as fgui.GComponent;
         this.EquipCom2 = panel.getChild("EquipCom2") as fgui.GComponent;
         this.EquipCom3 = panel.getChild("EquipCom3") as fgui.GComponent;
@@ -62,6 +60,10 @@ export class HomeVM extends FguiViewModel {
         this.BtnClub = panel.getChild("BtnClub") as fgui.GButton;
         this.BtnPlays = panel.getChild("BtnPlays") as fgui.GButton;
         this.Bottom = panel.getChild("bottom") as fgui.GGroup;
+        this.GridRoot = panel.getChild("gridRoot") as fgui.GComponent;
+        this.HdList = panel.getChild("hdList") as fgui.GList;
+        this.HeadTopCom = panel.getChild("HeadTopCom") as fgui.GComponent;
+        this.Top = panel.getChild("top") as fgui.GGroup;
 
     }
 }

+ 16 - 0
assets/script/logic/gridMap/UECell.ts

@@ -20,6 +20,8 @@ export default class UECell extends UEBase {
     private lbt_num: cc.Label = null!;
     @property(cc.Node)
     private node_select: cc.Node = null!;
+    @property(cc.Node)
+    private sp_item: cc.Node = null!;
 
     private originalPos: cc.Vec3 = cc.v3(0, 0);
     cellData: I_CellData = null!;
@@ -55,6 +57,10 @@ export default class UECell extends UEBase {
         }
     }
 
+    ClearCell() {
+
+    }
+
     /** 播放果冻效果 */
     PlayJellyAnim() {
         cc.tween(this.itemNode)
@@ -65,6 +71,16 @@ export default class UECell extends UEBase {
             .start();
     }
 
+    /** 播放合成动画 */
+    PlayMergeAnim() {
+        cc.tween(this.itemNode)
+            .by(0.1, { position: cc.v3(0, 40) })
+            .by(0.1, { position: cc.v3(0, -40) })
+            .by(0.1, { position: cc.v3(0, 10) })
+            .by(0.1, { position: cc.v3(0, -10) })
+            .start();
+    }
+
     private UpdateItemDisplay(): void {
         // 根据 itemType 和 itemLevel 更新物品显示
         if (this.itemNode) {

+ 6 - 1
assets/script/logic/gridMap/UEGridMap.ts

@@ -129,7 +129,12 @@ export default class UEGridMap extends UEBase {
         return null;
     }
 
+    /** 尝试合成 */
     private TryMergeItems(fromCell: UECell, toCell: UECell): void {
-
+        if (fromCell.cellData.type == toCell.cellData.type &&
+            fromCell.cellData.id != toCell.cellData.id &&
+            fromCell.cellData.level == toCell.cellData.level) {
+            toCell.PlayMergeAnim();
+        }
     }
 }

+ 13 - 10
fgui-project/assets/Home/Home.xml

@@ -1,18 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="750,1334" opaque="false">
   <displayList>
-    <component id="n27_qj2k" name="gridRoot" src="e0jk8c" fileName="Components/EmptyCom.xml" pkg="rd135cfr" xy="375,667" pivot="0.5,0.5" anchor="true">
+    <component id="n29_j8cn" name="bgRoot" src="e0jk8c" fileName="Components/EmptyCom.xml" pkg="rd135cfr" xy="375,667" pivot="0.5,0.5" anchor="true">
       <relation target="" sidePair="center-center,middle-middle"/>
     </component>
-    <list id="n25_miq9" name="hdList" xy="10,163" pivot="0,0.5" anchor="true" size="387,80" group="n26_miq9" layout="row" overflow="scroll" scroll="horizontal" colGap="20" defaultItem="ui://1xjqm8v2miq9e">
-      <item/>
-      <item/>
-      <item/>
-    </list>
-    <component id="n28_j8cn" name="HeadTopCom" src="miq9g" fileName="Components/HeadTopCom.xml" xy="375,150" pivot="0.5,0.5" anchor="true" group="n26_miq9"/>
-    <group id="n26_miq9" name="top" xy="0,0" size="750,300" advanced="true">
-      <relation target="" sidePair="top-top"/>
-    </group>
     <component id="n3_miq9" name="EquipCom1" src="miq92" fileName="Components/EquipCom.xml" xy="71,1154" pivot="0.5,0.5" anchor="true" group="n11_miq9" scale="0.8,0.8"/>
     <component id="n4_miq9" name="EquipCom2" src="miq92" fileName="Components/EquipCom.xml" xy="181,1154" pivot="0.5,0.5" anchor="true" group="n11_miq9" scale="0.8,0.8"/>
     <component id="n5_miq9" name="EquipCom3" src="miq92" fileName="Components/EquipCom.xml" xy="291,1154" pivot="0.5,0.5" anchor="true" group="n11_miq9" scale="0.8,0.8"/>
@@ -56,6 +47,18 @@
     <group id="n11_miq9" name="bottom" xy="0,927" size="750,404" advanced="true">
       <relation target="" sidePair="bottom-bottom"/>
     </group>
+    <component id="n27_qj2k" name="gridRoot" src="e0jk8c" fileName="Components/EmptyCom.xml" pkg="rd135cfr" xy="375,667" pivot="0.5,0.5" anchor="true">
+      <relation target="" sidePair="center-center,middle-middle"/>
+    </component>
+    <list id="n25_miq9" name="hdList" xy="10,163" pivot="0,0.5" anchor="true" size="387,80" group="n26_miq9" layout="row" overflow="scroll" scroll="horizontal" colGap="20" defaultItem="ui://1xjqm8v2miq9e">
+      <item/>
+      <item/>
+      <item/>
+    </list>
+    <component id="n28_j8cn" name="HeadTopCom" src="miq9g" fileName="Components/HeadTopCom.xml" xy="375,150" pivot="0.5,0.5" anchor="true" group="n26_miq9"/>
+    <group id="n26_miq9" name="top" xy="0,0" size="750,300" advanced="true">
+      <relation target="" sidePair="top-top"/>
+    </group>
   </displayList>
   <scriptData gencodez3qm0="1"/>
 </component>