mojunshou пре 1 година
родитељ
комит
311f91fecc
34 измењених фајлова са 15442 додато и 905 уклоњено
  1. 5 8
      assets/bundle/common/prefab/setting.prefab
  2. 1312 0
      assets/bundle/gui/eliminate/animation/tx_rotation1.anim
  3. 13 0
      assets/bundle/gui/eliminate/animation/tx_rotation1.anim.meta
  4. 2 5
      assets/bundle/gui/eliminate/eliminate.prefab
  5. 10610 0
      assets/bundle/gui/eliminate/gameView.prefab
  6. 13 0
      assets/bundle/gui/eliminate/gameView.prefab.meta
  7. 1231 801
      assets/bundle/gui/eliminate/prefab/cashWithdrawal.prefab
  8. 581 0
      assets/bundle/gui/eliminate/prefab/stateItem.prefab
  9. 13 0
      assets/bundle/gui/eliminate/prefab/stateItem.prefab.meta
  10. BIN
      assets/bundle/gui/eliminate/texture/bg/bg3.png
  11. 134 0
      assets/bundle/gui/eliminate/texture/bg/bg3.png.meta
  12. BIN
      assets/bundle/gui/eliminate/texture/icon_19.png
  13. 134 0
      assets/bundle/gui/eliminate/texture/icon_19.png.meta
  14. BIN
      assets/bundle/gui/eliminate/texture/icon_20.png
  15. 134 0
      assets/bundle/gui/eliminate/texture/icon_20.png.meta
  16. BIN
      assets/bundle/gui/eliminate/texture/vertical_line.png
  17. 134 0
      assets/bundle/gui/eliminate/texture/vertical_line.png.meta
  18. 1 1
      assets/script/game/Game.ts
  19. 0 3
      assets/script/game/account/model/AccountModelComp.ts
  20. 2 0
      assets/script/game/common/config/GameEvent.ts
  21. 8 3
      assets/script/game/common/config/GameUIConfig.ts
  22. 1 0
      assets/script/game/common/manager/LoginHandler.ts
  23. 11 4
      assets/script/game/common/manager/ProtocolEvent.ts
  24. 57 11
      assets/script/game/common/manager/ServerHandler.ts
  25. 21 13
      assets/script/game/common/setting/SettingViewComp.ts
  26. 11 16
      assets/script/game/initialize/view/LoadingViewComp.ts
  27. 1 1
      assets/script/game/model/GameModelComp.ts
  28. 33 17
      assets/script/game/view/CashWithdrawalView.ts
  29. 30 18
      assets/script/game/view/EliminateViewComp.ts
  30. 8 3
      assets/script/game/view/GameOverView.ts
  31. 3 1
      assets/script/game/view/GamePassView.ts
  32. 9 0
      assets/script/game/view/core.meta
  33. 921 0
      assets/script/game/view/core/GameView.ts
  34. 9 0
      assets/script/game/view/core/GameView.ts.meta

+ 5 - 8
assets/bundle/common/prefab/setting.prefab

@@ -995,8 +995,8 @@
     },
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 1.4519999999999982,
-      "y": 7.151000000000067,
+      "x": 0.002,
+      "y": 4.25,
       "z": 0
     },
     "_lrot": {
@@ -1036,8 +1036,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 120,
-      "height": 120
+      "width": 110,
+      "height": 110
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -1072,10 +1072,7 @@
       "b": 255,
       "a": 255
     },
-    "_spriteFrame": {
-      "__uuid__": "57520716-48c8-4a19-8acf-41c9f8777fb0@f9941",
-      "__expectedType__": "cc.SpriteFrame"
-    },
+    "_spriteFrame": null,
     "_type": 0,
     "_fillType": 0,
     "_sizeMode": 0,

Разлика између датотеке није приказан због своје велике величине
+ 1312 - 0
assets/bundle/gui/eliminate/animation/tx_rotation1.anim


+ 13 - 0
assets/bundle/gui/eliminate/animation/tx_rotation1.anim.meta

@@ -0,0 +1,13 @@
+{
+  "ver": "2.0.3",
+  "importer": "animation-clip",
+  "imported": true,
+  "uuid": "2bc1eb4a-1eb4-4a9c-b9b7-f705a8d98b88",
+  "files": [
+    ".cconb"
+  ],
+  "subMetas": {},
+  "userData": {
+    "name": "tx_rotation1"
+  }
+}

+ 2 - 5
assets/bundle/gui/eliminate/eliminate.prefab

@@ -10518,9 +10518,6 @@
     "lab_taget": {
       "__id__": 126
     },
-    "lab_brick": {
-      "__id__": 194
-    },
     "itemPrefabs": [
       {
         "__uuid__": "1ce492a0-34af-42cf-a465-0ea71b7a15c4",
@@ -10600,8 +10597,8 @@
     "autoBtn": {
       "__id__": 319
     },
-    "addSpeedBtn": {
-      "__id__": 340
+    "lab_goldNum": {
+      "__id__": 194
     },
     "_id": ""
   },

Разлика између датотеке није приказан због своје велике величине
+ 10610 - 0
assets/bundle/gui/eliminate/gameView.prefab


+ 13 - 0
assets/bundle/gui/eliminate/gameView.prefab.meta

@@ -0,0 +1,13 @@
+{
+  "ver": "1.1.50",
+  "importer": "prefab",
+  "imported": true,
+  "uuid": "002e5316-d9a3-40a3-9547-125f0527ac70",
+  "files": [
+    ".json"
+  ],
+  "subMetas": {},
+  "userData": {
+    "syncNodeName": "gameView"
+  }
+}

Разлика између датотеке није приказан због своје велике величине
+ 1231 - 801
assets/bundle/gui/eliminate/prefab/cashWithdrawal.prefab


+ 581 - 0
assets/bundle/gui/eliminate/prefab/stateItem.prefab

@@ -0,0 +1,581 @@
+[
+  {
+    "__type__": "cc.Prefab",
+    "_name": "stateItem",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_native": "",
+    "data": {
+      "__id__": 1
+    },
+    "optimizationPolicy": 0,
+    "persistent": false
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "stateItem",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": null,
+    "_children": [
+      {
+        "__id__": 2
+      },
+      {
+        "__id__": 8
+      },
+      {
+        "__id__": 14
+      }
+    ],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 20
+      },
+      {
+        "__id__": 22
+      }
+    ],
+    "_prefab": {
+      "__id__": 24
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "sp_icon1",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 3
+      },
+      {
+        "__id__": 5
+      }
+    ],
+    "_prefab": {
+      "__id__": 7
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 18,
+      "y": 0,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 2
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 4
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 36,
+      "height": 36
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "351fLHEqBPVIbTfn3fCmmM"
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 2
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 6
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_spriteFrame": {
+      "__uuid__": "55c1d083-41db-4ad3-9425-4eb0c56ce875@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "_type": 0,
+    "_fillType": 0,
+    "_sizeMode": 1,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_useGrayscale": false,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "a6Veu0zUpIVZWl/WKEGUP+"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "c7yNhRpMRGOLUmmiRue+5G",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "icon_20",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": false,
+    "_components": [
+      {
+        "__id__": 9
+      },
+      {
+        "__id__": 11
+      }
+    ],
+    "_prefab": {
+      "__id__": 13
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 8
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 10
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 32,
+      "height": 30
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "69lD/846hCzL/AG7jQVkXa"
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 8
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 12
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_spriteFrame": {
+      "__uuid__": "d061ae7e-71e1-4d90-949f-e6d7a8cd0c9f@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "_type": 0,
+    "_fillType": 0,
+    "_sizeMode": 1,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_useGrayscale": false,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "bbP5lMW9ZC54ASXLa0HFoJ"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "ea71UIZK5Ko6vWMRRa1kI5",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "lab_state1",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 15
+      },
+      {
+        "__id__": 17
+      }
+    ],
+    "_prefab": {
+      "__id__": 19
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 130,
+      "y": 0,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 14
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 16
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 168,
+      "height": 50.4
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "79ROtSCQ9DyIt7yOKW92RS"
+  },
+  {
+    "__type__": "cc.Label",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 14
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 18
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 32,
+      "g": 32,
+      "b": 32,
+      "a": 255
+    },
+    "_string": "发起提现申请",
+    "_horizontalAlign": 1,
+    "_verticalAlign": 1,
+    "_actualFontSize": 28,
+    "_fontSize": 28,
+    "_fontFamily": "Arial",
+    "_lineHeight": 40,
+    "_overflow": 0,
+    "_enableWrapText": true,
+    "_font": null,
+    "_isSystemFontUsed": true,
+    "_spacingX": 0,
+    "_isItalic": false,
+    "_isBold": false,
+    "_isUnderline": false,
+    "_underlineHeight": 2,
+    "_cacheMode": 0,
+    "_enableOutline": false,
+    "_outlineColor": {
+      "__type__": "cc.Color",
+      "r": 0,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_outlineWidth": 2,
+    "_enableShadow": false,
+    "_shadowColor": {
+      "__type__": "cc.Color",
+      "r": 0,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_shadowOffset": {
+      "__type__": "cc.Vec2",
+      "x": 2,
+      "y": 2
+    },
+    "_shadowBlur": 2,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "3bFx/A3BFG7INkIeR2MKMq"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "33vCUmTqhEDZ63YrwTIIq1",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 21
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 214,
+      "height": 36
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "e0Dz3xLbFGqYaCoVHqF758"
+  },
+  {
+    "__type__": "cc.Layout",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 23
+    },
+    "_resizeMode": 1,
+    "_layoutType": 1,
+    "_cellSize": {
+      "__type__": "cc.Size",
+      "width": 40,
+      "height": 40
+    },
+    "_startAxis": 0,
+    "_paddingLeft": 0,
+    "_paddingRight": 0,
+    "_paddingTop": 0,
+    "_paddingBottom": 0,
+    "_spacingX": 10,
+    "_spacingY": 0,
+    "_verticalDirection": 1,
+    "_horizontalDirection": 0,
+    "_constraint": 0,
+    "_constraintNum": 2,
+    "_affectedByScale": false,
+    "_isAlign": false,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "f3PgdUZrhDgI45SM/WwUT3"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "96CGE5Ft9DJrhNlL7I8PHH",
+    "instance": null,
+    "targetOverrides": null
+  }
+]

+ 13 - 0
assets/bundle/gui/eliminate/prefab/stateItem.prefab.meta

@@ -0,0 +1,13 @@
+{
+  "ver": "1.1.50",
+  "importer": "prefab",
+  "imported": true,
+  "uuid": "562a487b-72a8-4f11-9780-615016a93316",
+  "files": [
+    ".json"
+  ],
+  "subMetas": {},
+  "userData": {
+    "syncNodeName": "stateItem"
+  }
+}

BIN
assets/bundle/gui/eliminate/texture/bg/bg3.png


+ 134 - 0
assets/bundle/gui/eliminate/texture/bg/bg3.png.meta

@@ -0,0 +1,134 @@
+{
+  "ver": "1.0.27",
+  "importer": "image",
+  "imported": true,
+  "uuid": "c5a17437-1409-43d2-bfd2-3cef9ed01a47",
+  "files": [
+    ".json",
+    ".png"
+  ],
+  "subMetas": {
+    "6c48a": {
+      "importer": "texture",
+      "uuid": "c5a17437-1409-43d2-bfd2-3cef9ed01a47@6c48a",
+      "displayName": "bg3",
+      "id": "6c48a",
+      "name": "texture",
+      "userData": {
+        "wrapModeS": "clamp-to-edge",
+        "wrapModeT": "clamp-to-edge",
+        "imageUuidOrDatabaseUri": "c5a17437-1409-43d2-bfd2-3cef9ed01a47",
+        "isUuid": true,
+        "visible": false,
+        "minfilter": "linear",
+        "magfilter": "linear",
+        "mipfilter": "none",
+        "anisotropy": 0
+      },
+      "ver": "1.0.22",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    },
+    "f9941": {
+      "importer": "sprite-frame",
+      "uuid": "c5a17437-1409-43d2-bfd2-3cef9ed01a47@f9941",
+      "displayName": "bg3",
+      "id": "f9941",
+      "name": "spriteFrame",
+      "userData": {
+        "trimThreshold": 1,
+        "rotated": false,
+        "offsetX": 0,
+        "offsetY": 0,
+        "trimX": 0,
+        "trimY": 0,
+        "width": 640,
+        "height": 889,
+        "rawWidth": 640,
+        "rawHeight": 889,
+        "borderTop": 0,
+        "borderBottom": 0,
+        "borderLeft": 0,
+        "borderRight": 0,
+        "packable": true,
+        "pixelsToUnit": 100,
+        "pivotX": 0.5,
+        "pivotY": 0.5,
+        "meshType": 0,
+        "vertices": {
+          "rawPosition": [
+            -320,
+            -444.5,
+            0,
+            320,
+            -444.5,
+            0,
+            -320,
+            444.5,
+            0,
+            320,
+            444.5,
+            0
+          ],
+          "indexes": [
+            0,
+            1,
+            2,
+            2,
+            1,
+            3
+          ],
+          "uv": [
+            0,
+            889,
+            640,
+            889,
+            0,
+            0,
+            640,
+            0
+          ],
+          "nuv": [
+            0,
+            0,
+            1,
+            0,
+            0,
+            1,
+            1,
+            1
+          ],
+          "minPos": [
+            -320,
+            -444.5,
+            0
+          ],
+          "maxPos": [
+            320,
+            444.5,
+            0
+          ]
+        },
+        "isUuid": true,
+        "imageUuidOrDatabaseUri": "c5a17437-1409-43d2-bfd2-3cef9ed01a47@6c48a",
+        "atlasUuid": "",
+        "trimType": "auto"
+      },
+      "ver": "1.0.12",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    }
+  },
+  "userData": {
+    "type": "sprite-frame",
+    "hasAlpha": true,
+    "fixAlphaTransparencyArtifacts": false,
+    "redirect": "c5a17437-1409-43d2-bfd2-3cef9ed01a47@6c48a"
+  }
+}

BIN
assets/bundle/gui/eliminate/texture/icon_19.png


+ 134 - 0
assets/bundle/gui/eliminate/texture/icon_19.png.meta

@@ -0,0 +1,134 @@
+{
+  "ver": "1.0.27",
+  "importer": "image",
+  "imported": true,
+  "uuid": "55c1d083-41db-4ad3-9425-4eb0c56ce875",
+  "files": [
+    ".json",
+    ".png"
+  ],
+  "subMetas": {
+    "6c48a": {
+      "importer": "texture",
+      "uuid": "55c1d083-41db-4ad3-9425-4eb0c56ce875@6c48a",
+      "displayName": "icon_19",
+      "id": "6c48a",
+      "name": "texture",
+      "userData": {
+        "wrapModeS": "clamp-to-edge",
+        "wrapModeT": "clamp-to-edge",
+        "imageUuidOrDatabaseUri": "55c1d083-41db-4ad3-9425-4eb0c56ce875",
+        "isUuid": true,
+        "visible": false,
+        "minfilter": "linear",
+        "magfilter": "linear",
+        "mipfilter": "none",
+        "anisotropy": 0
+      },
+      "ver": "1.0.22",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    },
+    "f9941": {
+      "importer": "sprite-frame",
+      "uuid": "55c1d083-41db-4ad3-9425-4eb0c56ce875@f9941",
+      "displayName": "icon_19",
+      "id": "f9941",
+      "name": "spriteFrame",
+      "userData": {
+        "trimThreshold": 1,
+        "rotated": false,
+        "offsetX": 0,
+        "offsetY": 0,
+        "trimX": 0,
+        "trimY": 0,
+        "width": 36,
+        "height": 36,
+        "rawWidth": 36,
+        "rawHeight": 36,
+        "borderTop": 0,
+        "borderBottom": 0,
+        "borderLeft": 0,
+        "borderRight": 0,
+        "packable": true,
+        "pixelsToUnit": 100,
+        "pivotX": 0.5,
+        "pivotY": 0.5,
+        "meshType": 0,
+        "vertices": {
+          "rawPosition": [
+            -18,
+            -18,
+            0,
+            18,
+            -18,
+            0,
+            -18,
+            18,
+            0,
+            18,
+            18,
+            0
+          ],
+          "indexes": [
+            0,
+            1,
+            2,
+            2,
+            1,
+            3
+          ],
+          "uv": [
+            0,
+            36,
+            36,
+            36,
+            0,
+            0,
+            36,
+            0
+          ],
+          "nuv": [
+            0,
+            0,
+            1,
+            0,
+            0,
+            1,
+            1,
+            1
+          ],
+          "minPos": [
+            -18,
+            -18,
+            0
+          ],
+          "maxPos": [
+            18,
+            18,
+            0
+          ]
+        },
+        "isUuid": true,
+        "imageUuidOrDatabaseUri": "55c1d083-41db-4ad3-9425-4eb0c56ce875@6c48a",
+        "atlasUuid": "",
+        "trimType": "auto"
+      },
+      "ver": "1.0.12",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    }
+  },
+  "userData": {
+    "type": "sprite-frame",
+    "hasAlpha": true,
+    "fixAlphaTransparencyArtifacts": false,
+    "redirect": "55c1d083-41db-4ad3-9425-4eb0c56ce875@6c48a"
+  }
+}

BIN
assets/bundle/gui/eliminate/texture/icon_20.png


+ 134 - 0
assets/bundle/gui/eliminate/texture/icon_20.png.meta

@@ -0,0 +1,134 @@
+{
+  "ver": "1.0.27",
+  "importer": "image",
+  "imported": true,
+  "uuid": "d061ae7e-71e1-4d90-949f-e6d7a8cd0c9f",
+  "files": [
+    ".json",
+    ".png"
+  ],
+  "subMetas": {
+    "6c48a": {
+      "importer": "texture",
+      "uuid": "d061ae7e-71e1-4d90-949f-e6d7a8cd0c9f@6c48a",
+      "displayName": "icon_20",
+      "id": "6c48a",
+      "name": "texture",
+      "userData": {
+        "wrapModeS": "clamp-to-edge",
+        "wrapModeT": "clamp-to-edge",
+        "imageUuidOrDatabaseUri": "d061ae7e-71e1-4d90-949f-e6d7a8cd0c9f",
+        "isUuid": true,
+        "visible": false,
+        "minfilter": "linear",
+        "magfilter": "linear",
+        "mipfilter": "none",
+        "anisotropy": 0
+      },
+      "ver": "1.0.22",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    },
+    "f9941": {
+      "importer": "sprite-frame",
+      "uuid": "d061ae7e-71e1-4d90-949f-e6d7a8cd0c9f@f9941",
+      "displayName": "icon_20",
+      "id": "f9941",
+      "name": "spriteFrame",
+      "userData": {
+        "trimThreshold": 1,
+        "rotated": false,
+        "offsetX": 0,
+        "offsetY": 0,
+        "trimX": 0,
+        "trimY": 1,
+        "width": 32,
+        "height": 30,
+        "rawWidth": 32,
+        "rawHeight": 32,
+        "borderTop": 0,
+        "borderBottom": 0,
+        "borderLeft": 0,
+        "borderRight": 0,
+        "packable": true,
+        "pixelsToUnit": 100,
+        "pivotX": 0.5,
+        "pivotY": 0.5,
+        "meshType": 0,
+        "vertices": {
+          "rawPosition": [
+            -16,
+            -15,
+            0,
+            16,
+            -15,
+            0,
+            -16,
+            15,
+            0,
+            16,
+            15,
+            0
+          ],
+          "indexes": [
+            0,
+            1,
+            2,
+            2,
+            1,
+            3
+          ],
+          "uv": [
+            0,
+            31,
+            32,
+            31,
+            0,
+            1,
+            32,
+            1
+          ],
+          "nuv": [
+            0,
+            0.03125,
+            1,
+            0.03125,
+            0,
+            0.96875,
+            1,
+            0.96875
+          ],
+          "minPos": [
+            -16,
+            -15,
+            0
+          ],
+          "maxPos": [
+            16,
+            15,
+            0
+          ]
+        },
+        "isUuid": true,
+        "imageUuidOrDatabaseUri": "d061ae7e-71e1-4d90-949f-e6d7a8cd0c9f@6c48a",
+        "atlasUuid": "",
+        "trimType": "auto"
+      },
+      "ver": "1.0.12",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    }
+  },
+  "userData": {
+    "type": "sprite-frame",
+    "hasAlpha": true,
+    "fixAlphaTransparencyArtifacts": false,
+    "redirect": "d061ae7e-71e1-4d90-949f-e6d7a8cd0c9f@6c48a"
+  }
+}

BIN
assets/bundle/gui/eliminate/texture/vertical_line.png


+ 134 - 0
assets/bundle/gui/eliminate/texture/vertical_line.png.meta

@@ -0,0 +1,134 @@
+{
+  "ver": "1.0.27",
+  "importer": "image",
+  "imported": true,
+  "uuid": "42495932-b472-4af7-8910-6c74366a700f",
+  "files": [
+    ".json",
+    ".png"
+  ],
+  "subMetas": {
+    "6c48a": {
+      "importer": "texture",
+      "uuid": "42495932-b472-4af7-8910-6c74366a700f@6c48a",
+      "displayName": "vertical_line",
+      "id": "6c48a",
+      "name": "texture",
+      "userData": {
+        "wrapModeS": "clamp-to-edge",
+        "wrapModeT": "clamp-to-edge",
+        "imageUuidOrDatabaseUri": "42495932-b472-4af7-8910-6c74366a700f",
+        "isUuid": true,
+        "visible": false,
+        "minfilter": "linear",
+        "magfilter": "linear",
+        "mipfilter": "none",
+        "anisotropy": 0
+      },
+      "ver": "1.0.22",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    },
+    "f9941": {
+      "importer": "sprite-frame",
+      "uuid": "42495932-b472-4af7-8910-6c74366a700f@f9941",
+      "displayName": "vertical_line",
+      "id": "f9941",
+      "name": "spriteFrame",
+      "userData": {
+        "trimThreshold": 1,
+        "rotated": false,
+        "offsetX": 0,
+        "offsetY": 0,
+        "trimX": 2,
+        "trimY": 2,
+        "width": 4,
+        "height": 31,
+        "rawWidth": 8,
+        "rawHeight": 35,
+        "borderTop": 0,
+        "borderBottom": 0,
+        "borderLeft": 0,
+        "borderRight": 0,
+        "packable": true,
+        "pixelsToUnit": 100,
+        "pivotX": 0.5,
+        "pivotY": 0.5,
+        "meshType": 0,
+        "vertices": {
+          "rawPosition": [
+            -2,
+            -15.5,
+            0,
+            2,
+            -15.5,
+            0,
+            -2,
+            15.5,
+            0,
+            2,
+            15.5,
+            0
+          ],
+          "indexes": [
+            0,
+            1,
+            2,
+            2,
+            1,
+            3
+          ],
+          "uv": [
+            2,
+            33,
+            6,
+            33,
+            2,
+            2,
+            6,
+            2
+          ],
+          "nuv": [
+            0.25,
+            0.05714285714285714,
+            0.75,
+            0.05714285714285714,
+            0.25,
+            0.9428571428571428,
+            0.75,
+            0.9428571428571428
+          ],
+          "minPos": [
+            -2,
+            -15.5,
+            0
+          ],
+          "maxPos": [
+            2,
+            15.5,
+            0
+          ]
+        },
+        "isUuid": true,
+        "imageUuidOrDatabaseUri": "42495932-b472-4af7-8910-6c74366a700f@6c48a",
+        "atlasUuid": "",
+        "trimType": "auto"
+      },
+      "ver": "1.0.12",
+      "imported": true,
+      "files": [
+        ".json"
+      ],
+      "subMetas": {}
+    }
+  },
+  "userData": {
+    "type": "sprite-frame",
+    "hasAlpha": true,
+    "fixAlphaTransparencyArtifacts": false,
+    "redirect": "42495932-b472-4af7-8910-6c74366a700f@6c48a"
+  }
+}

+ 1 - 1
assets/script/game/Game.ts

@@ -6,7 +6,7 @@ import { EliminateViewComp } from "./view/EliminateViewComp";
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-04-10 15:19:17
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-10 15:22:37
+ * @LastEditTime: 2025-04-14 16:31:24
  * @Description: 
  */
 @ecs.register('Game')

+ 0 - 3
assets/script/game/account/model/AccountModelComp.ts

@@ -29,7 +29,6 @@ export class AccountModelComp extends ecs.Comp {
     _curLevel: number = 0;
     /**游戏币*/
     _wxCoin: number = 0;
-
     /**红包币*/
     _hbCoin: number = 0;
     /**金块*/
@@ -65,8 +64,6 @@ export class AccountModelComp extends ecs.Comp {
         this.uid = -1;
         this.headUrl = null!;
         this.curLevel = 0;
-        this.gameCoin = 0;
-        this.cashCoin = 0;
     }
 
 

+ 2 - 0
assets/script/game/common/config/GameEvent.ts

@@ -27,4 +27,6 @@ export enum GameEvent {
     openRecordView = "openRecordView",
     /**展示金币动画*/
     showCoinAnimation = "showCoinAnimation",
+    //复活游戏
+
 }

+ 8 - 3
assets/script/game/common/config/GameUIConfig.ts

@@ -1,7 +1,7 @@
 /*
  * @Date: 2021-08-12 09:33:37
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-02 18:29:59
+ * @LastEditTime: 2025-04-14 18:18:35
  */
 import { LayerType, UIConfig } from "../../../../../extensions/oops-plugin-framework/assets/core/gui/layer/LayerManager";
 
@@ -47,7 +47,10 @@ export enum UIID {
     WithdrawRecord,
     /** 微信提现 */
     WechatWithdraw,
-    GameView
+    GameView,
+    //提现成功
+    WithSussce,
+
 }
 
 /** 打开界面方式的配置数据 */
@@ -72,6 +75,8 @@ export var UIConfigData: { [key: number]: UIConfig } = {
     [UIID.Verify]: { layer: LayerType.PopUp, prefab: "gui/eliminate/prefab/verify" },
     [UIID.WithdrawRecord]: { layer: LayerType.UI, prefab: "gui/eliminate/prefab/withdrawalRecord" },
     [UIID.WechatWithdraw]: { layer: LayerType.UI, prefab: "gui/eliminate/prefab/wechatWithdrawal" },
-    [UIID.GameView]: { layer: LayerType.UI, prefab: "gui/eliminate/gameView" }
+    [UIID.GameView]: { layer: LayerType.UI, prefab: "gui/eliminate/gameView" },
+    [UIID.WithSussce]: { layer: LayerType.PopUp, prefab: "gui/eliminate/prefab/cashWithdrawal" }
+
 
 }

+ 1 - 0
assets/script/game/common/manager/LoginHandler.ts

@@ -58,6 +58,7 @@ export class LoginHandler {
         console.log('[微信] 登录成功', str);
         // this.wxLogin(str);
         //向服务器申请登录
+        ServerHandler.inst.wxLogin(str);
     }
 
     wechatLoginFail(str: string) {

+ 11 - 4
assets/script/game/common/manager/ProtocolEvent.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-04-07 10:17:16
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-11 17:38:34
+ * @LastEditTime: 2025-04-14 17:26:45
  * @Description: 消息定义
  */
 
@@ -53,15 +53,22 @@ export enum ProtocolEvent {
     /**下一关*/
     NextLevel = server_url + "/project/playlet/v1/checkPoint/next",
     /**获取通关奖励数*/
-    getGameAward = server_url + "/project/playlet/v1/reward/passView",
+    GetGameAward = server_url + "/project/playlet/v1/reward/passView",
     /**惊喜翻倍奖励信息*/
-    getDoubleAwardInfo = server_url + "/project/playlet/v1/reward/doubleView",
+    GetDoubleAwardInfo = server_url + "/project/playlet/v1/reward/doubleView",
     /**提现返利信息*/
     GetWithdrawReward = server_url + "/project/playlet/v1/withdraw/rebate",
     /**广告视频开始*/
     AdVideoStart = server_url + "/project/playlet/v1/video/start",
     /**视频奖励*/
-    getVideorReward = server_url + "/project/playlet/v1/reward/videoReward"
+    GetVideorReward = server_url + "/project/playlet/v1/reward/videoReward",
+    //重新开始游戏
+    RestartGame = server_url + "/project/playlet/v1/checkPoint/restart",
+    //微信提现页面
+    WechatReward = server_url + "/project/playlet/v1/reward/weal",
+
+
+
 
 
 

+ 57 - 11
assets/script/game/common/manager/ServerHandler.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-04-11 10:16:41
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-11 19:06:30
+ * @LastEditTime: 2025-04-14 17:44:08
  * @Description: 
  */
 // ServerHandler.ts
@@ -11,6 +11,7 @@ import { GameEvent } from '../config/GameEvent';
 import { oops } from 'db://oops-framework/core/Oops';
 import { CocosHandler, CocosHandlerType } from './CocosHandler';
 import { ProtocolEvent } from './ProtocolEvent';
+import { url } from 'inspector';
 
 export class ServerHandler {
     private static _inst: ServerHandler;
@@ -51,7 +52,8 @@ export class ServerHandler {
 
     onWxLoginInfo(str: string) {
         console.log('[服务器] 微信登录返回', str);
-
+        // let 
+        this.getAccountInfo();
     }
 
 
@@ -151,7 +153,7 @@ export class ServerHandler {
 
     getGameAwardInfo() {
         const param = {
-            url: ProtocolEvent.getGameAward,
+            url: ProtocolEvent.GetGameAward,
             callback: this.buildCallback('ServerHandler.inst.onGameAwardInfo', 'ServerHandler.inst.onRequestFail')
         };
         this.sendMsgToServer(param);
@@ -182,7 +184,7 @@ export class ServerHandler {
     //获取双倍奖励返回
     getDoubleSurprise() {
         const param = {
-            url: ProtocolEvent.getDoubleAwardInfo,
+            url: ProtocolEvent.GetDoubleAwardInfo,
             callback: this.buildCallback('ServerHandler.inst.onDoubleSurprise', 'ServerHandler.inst.onRequestFail')
         };
         this.sendMsgToServer(param);
@@ -256,14 +258,16 @@ export class ServerHandler {
     //直接领取通关奖励返回
     onGetPassRewards(str: string) {
         console.log('[服务器] 直接领取通关奖励成功返回', str);
+        let result = JSON.parse(str);
+        smc.game.GameModel.changeHbCoin = result.changes["1004"] / 100;
+        smc.game.GameModel.changeHbCoin = result.changes["1005"] / 1000;
+        smc.account.AccountModel.wxCoin = result.props["1005"];
+        smc.account.AccountModel.hbCoin = result.props["1004"];
         oops.message.dispatchEvent(GameEvent.showCoinAnimation);
+        //请求下一局
+        this.getNextLevel();
     }
 
-
-
-
-
-
     //少量领取翻倍奖励
     getLittleRewards() {
         const level = smc.account.AccountModel.curLevel;
@@ -281,8 +285,9 @@ export class ServerHandler {
     onGetDoubleRewards(str: string) {
         console.log('[服务器] 直接领取通关奖励成功返回', str);
         oops.message.dispatchEvent(GameEvent.showCoinAnimation);
-    }
+        //下一关事件
 
+    }
 
     //获取视频奖励
     getVideorReward() {
@@ -290,7 +295,7 @@ export class ServerHandler {
         const level = smc.account.AccountModel.curLevel;
         let type = smc.game.GameModel.viewType;
         const param = {
-            url: ProtocolEvent.getVideorReward,
+            url: ProtocolEvent.GetVideorReward,
             param: {
                 level: level,
                 type: type,
@@ -329,6 +334,47 @@ export class ServerHandler {
     }
 
 
+    //下一关
+    getNextLevel() {
+        const level = smc.account.AccountModel.curLevel;
+        const param = {
+            url: ProtocolEvent.NextLevel,
+            param: {
+                nextLevel: level + 1
+            },
+            callback: this.buildCallback('ServerHandler.inst.onGetNextLevel', 'ServerHandler.inst.onRequestFail')
+        }
+        this.sendMsgToServer(param);
+    }
+
+    onGetNextLevel(str: string) {
+        console.log('[服务器] 下一关数据返回', str);
+        let result = JSON.parse(str);
+        smc.account.AccountModel.curLevel = result.currentLevelData.level;
+        smc.game.GameModel.targetScore = result.currentLevelData.score;
+        oops.message.dispatchEvent(GameEvent.RestartGame);
+    }
+
+
+    //重新开始游戏
+    RestartGame() {
+        const param = {
+            url: ProtocolEvent.RestartGame,
+            callback: this.buildCallback('ServerHandler.inst.onRestartGame', 'ServerHandler.inst.onRequestFail')
+        }
+        this.sendMsgToServer(param);
+    }
+
+
+    onRestartGame(str: string) {
+        console.log('[服务器] 重新开始游戏返回', str);
+        let result = JSON.parse(str);
+        smc.account.AccountModel.curLevel = result.currentLevelData.level;
+        smc.game.GameModel.curScore = result.currentLevelData.score;
+        oops.message.dispatchEvent(GameEvent.RestartGame);
+    }
+
+
 
     onRequestFail(code: number, str: string) {
         console.log('[服务器] 请求失败', code, str);

+ 21 - 13
assets/script/game/common/setting/SettingViewComp.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-20 15:40:20
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-11 11:23:02
+ * @LastEditTime: 2025-04-14 18:01:16
  * @Description:设置界面 
  */
 import { _decorator } from "cc";
@@ -19,6 +19,8 @@ import { Button } from "cc";
 import { smc } from "../SingletonModuleComp";
 import { CocosHandler } from "../manager/CocosHandler";
 import { LoginHandler } from "../manager/LoginHandler";
+import { UITransform } from "cc";
+import { Size } from "cc";
 const { ccclass, property } = _decorator;
 
 /** 视图层对象 */
@@ -114,18 +116,24 @@ export class SettingViewComp extends CCVMParentComp {
     private updateHead() {
         this.data.uid = smc.account.AccountModel.uid;
         let url = smc.account.AccountModel.headUrl;
-        // let sprite = this.node.getChildByPath("Bg/btn_head/sp_head")!.uiSprite;
-        // let url = "http://www.kuaipng.com/Uploads/pic/w/2020/07-16/89010/water_89010_698_698_.png"
-        // var opt: IRemoteOptions = { ext: ".png" };
-        // var onComplete = (err: Error | null, data: ImageAsset) => {
-        //     const texture = new Texture2D();
-        //     texture.image = data;
-
-        //     const spriteFrame = new SpriteFrame();
-        //     spriteFrame.texture = texture;
-        //     sprite.spriteFrame = spriteFrame;
-        // }
-        // resLoader.loadRemote<ImageAsset>(url, opt, onComplete);
+        let spriteNode = this.node.getChildByPath("Bg/btn_head/Mask/sp_head");
+        if (spriteNode) {
+            const uiTransform = spriteNode.getComponent(UITransform);
+            uiTransform?.setContentSize(new Size(110, 110))
+            let sprite = spriteNode.getComponent(Sprite);
+            if (sprite) {
+                console.log("更新头像啦")
+                var opt: IRemoteOptions = { ext: ".png" };
+                var onComplete = (err: Error | null, data: ImageAsset) => {
+                    const texture = new Texture2D();
+                    texture.image = data;
+                    const spriteFrame = new SpriteFrame();
+                    spriteFrame.texture = texture;
+                    sprite.spriteFrame = spriteFrame;
+                }
+                resLoader.loadRemote<ImageAsset>(url, opt, onComplete);
+            }
+        }
     }
 
 

+ 11 - 16
assets/script/game/initialize/view/LoadingViewComp.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-19 16:23:51
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-14 11:50:19
+ * @LastEditTime: 2025-04-14 17:33:44
  * @Description: loading界面
  */
 import { _decorator, Toggle } from "cc";
@@ -57,9 +57,6 @@ export class LoadingViewComp extends CCVMParentComp {
         this.on(GameEvent.UserLogin, this.userLogin, this);
     }
 
-
-
-
     async enter() {
         if (DeviceUtil.isNative && DeviceUtil.isAndroid) {
             const state = await LoginHandler.inst.getPrivacyStatus();
@@ -85,16 +82,14 @@ export class LoadingViewComp extends CCVMParentComp {
         console.log("登录状态>>>>>>>>>>>>>>>>", isLogin);
 
         //暂时隐藏
-        // if (isLogin) {
-        //     //登录过
-        //     this.setWxLoginBtnState(false);
-        //     this.loadRes();
-        // } else {
-        //     this.setWxLoginBtnState(true);
-        // }
-
-        this.loadRes();
-
+        if (isLogin) {
+            //登录过
+            this.setWxLoginBtnState(false);
+            this.loadRes();
+        } else {
+            this.setWxLoginBtnState(true);
+        }
+        // this.loadRes();
     }
 
 
@@ -172,9 +167,9 @@ export class LoadingViewComp extends CCVMParentComp {
             return;
         }
         //暂时跳过这个登录
-        // CocosHandler.inst.wechat_login();
+        LoginHandler.inst.wechatLogin();
         //直接获取信息
-        ServerHandler.inst.getAccountInfo();
+        // ServerHandler.inst.getAccountInfo();
     }
 
     /**

+ 1 - 1
assets/script/game/model/GameModelComp.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-04-10 14:49:42
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-11 18:13:43
+ * @LastEditTime: 2025-04-14 16:33:50
  * @Description: 
  */
 import { ecs } from "db://oops-framework/libs/ecs/ECS";

+ 33 - 17
assets/script/game/view/CashWithdrawalView.ts

@@ -2,35 +2,51 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-21 15:03:37
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-10 11:26:51
+ * @LastEditTime: 2025-04-14 18:15:34
  * @Description: 微信提现到零钱,需要有一个动画展示步骤
  */
 import { _decorator } from 'cc';
+import { DeviceUtil } from 'db://oops-framework/core/utils/DeviceUtil';
 import { GameComponent } from "db://oops-framework/module/common/GameComponent";
+import { ServerHandler } from '../common/manager/ServerHandler';
+import { oops } from 'db://oops-framework/core/Oops';
+import { UIID } from '../common/config/GameUIConfig';
 
 const { ccclass, property } = _decorator;
 
 /** 显示对象控制 */
 @ccclass('CashWithdrawalView')
 export class CashWithdrawalView extends GameComponent {
+    str: string[] = [
+        "发起提现申请",
+        "确认用户信息",
+        "发起打款:$m元",
+        "提现成功,到账微信零钱"
+    ]
+
+
+
+
+
     protected start() {
+        this.setButton();
+    }
+
+    showAnimation() {
+
+
 
     }
 
-    /**
-     * 
-     * 
-     * 
-     * 
-     * 
-     * 
-     * list[
-     * 
-     * 
-     * 
-     * 
-     * 
-     * 
-     * ]
-    */
+    btn_continue() {
+        //打开提现返利界面
+        if (DeviceUtil.isNative && DeviceUtil.isAndroid) {
+            ServerHandler.inst.getTxbfInfo();
+            oops.gui.remove(UIID.WithSussce);
+        } else {
+            //
+            oops.gui.open(UIID.CashRebate);
+        }
+
+    }
 }

+ 30 - 18
assets/script/game/view/EliminateViewComp.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-20 15:01:09
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-14 15:26:29
+ * @LastEditTime: 2025-04-14 17:22:29
  * @Description: 消除游戏主场景
  */
 import { _decorator, Button, Color, EventTouch, instantiate, JsonAsset, Label, Node, Prefab, randomRangeInt, Sprite, tween, UITransform, Vec2, Vec3, Widget } from "cc";
@@ -120,6 +120,9 @@ export class EliminateViewComp extends CCComp {
     @property({ type: Button, displayName: "自动按钮" })
     private autoBtn: Button = null!;
 
+    @property({ type: Label, displayName: "第几块金砖" })
+    private lab_goldNum: Label = null!;
+
     //游戏配置行列
     private rows: number = 8;       // 行数
     private cols: number = 8;       // 列数
@@ -205,6 +208,7 @@ export class EliminateViewComp extends CCComp {
         oops.message.on(GameEvent.DoubleSpeedOpenSuccess, this.doubleSpeedOpenSuccess, this);
         oops.message.on(GameEvent.openView, this.openView, this);
         oops.message.on(GameEvent.showCoinAnimation, this.showCoinAnimation, this);
+        oops.message.on(GameEvent.Resurrection, this.onResurrection, this)
     }
 
 
@@ -250,6 +254,8 @@ export class EliminateViewComp extends CCComp {
     }
 
 
+
+
     //设置数据
     setData() {
         this.score = smc.game.GameModel.curScore || 0;
@@ -260,6 +266,9 @@ export class EliminateViewComp extends CCComp {
         this.amountLb.string = this.money.toString();
         this.awardLb.string = this.cash.toString();
         this.lab_taget.string = this.targetScore.toString();
+        this.lab_goldNum.string = smc.account.AccountModel.goldCoin.toString();
+        console.log("目标分数>>>>>>", this.targetScore);
+        console.log("金块>>>>>>>>>>", smc.account.AccountModel.goldCoin)
     }
 
 
@@ -281,6 +290,10 @@ export class EliminateViewComp extends CCComp {
         }
     }
 
+    //复活,分数不清零
+    onResurrection() {
+        console.log("复活游戏,分数不清零");
+    }
 
     //显示金币动画
     showCoinAnimation(event: string, args: string) {
@@ -685,30 +698,23 @@ export class EliminateViewComp extends CCComp {
             brickNode.scale_y = 1;
             // 重置编辑中的网格数据
             this.editingData.gridList.length = 0;
-            //
-
-
             // 检查方块每个子网格是否与游戏网格重叠
             const tempGridList: GridData[] = [];
             let allEmptyGrids: boolean = true; // 标记是否所有网格都为空
-
             brickNode.children.forEach((childNode) => {
                 const childWorldPos = childNode.getWorldPosition();
-
                 // 查找与子网格重叠的游戏网格
                 let matchedGrid: GridData | null = null;
                 for (let row = 0; row < this.rows && !matchedGrid; row++) {
                     for (let col = 0; col < this.cols && !matchedGrid; col++) {
                         const grid = this.gridList[row][col];
                         if (!grid || !grid.gridNode) continue;
-
                         const gridPos = grid.gridNode.getWorldPosition();
                         if (Vec3.distance(gridPos, childWorldPos) <= (this.itemSize / 2)) {
                             matchedGrid = grid;
                         }
                     }
                 }
-
                 if (matchedGrid) {
                     tempGridList.push(matchedGrid);
                     // 检查是否有非空网格
@@ -803,8 +809,6 @@ export class EliminateViewComp extends CCComp {
 
                 // 销毁方块节点
                 brickNode.destroy();
-
-
                 // 添加新方块到待选区
                 this.addBrick(this.editingData.brickData.index);
 
@@ -931,6 +935,7 @@ export class EliminateViewComp extends CCComp {
 
         // 更新总分
         this.score += calculatedScore;
+        this.updateGameScore();
         this.lab_score.string = this.score.toString();
         //计算总分够一局没有,够就马上停止,展示界面
     }
@@ -1074,6 +1079,7 @@ export class EliminateViewComp extends CCComp {
                 }
 
                 this.score += score;
+                this.updateGameScore();
                 this.lab_score.string = this.score.toString();
                 if (DeviceUtil.isNative && DeviceUtil.isAndroid) {
                     ServerHandler.inst.updateEliminationReward({
@@ -1483,10 +1489,15 @@ export class EliminateViewComp extends CCComp {
     //更新游戏分数
     updateGameScore() {
         if (this.score >= this.targetScore) {
-            //修改游戏状态
+            console.log("通关啦")
             this.gameState = GameState.GAME_PASS;
-            //弹出恭喜通关
-
+            this.setGameState(this.gameState);
+            //弹出通关奖励界面
+            if (DeviceUtil.isNative && DeviceUtil.isAndroid) {
+                ServerHandler.inst.getGameAwardInfo();
+            } else {
+                console.log("打开通关奖励");
+            }
         }
     }
 
@@ -1512,6 +1523,11 @@ export class EliminateViewComp extends CCComp {
                 break;
             case GameState.GAME_OVER:
                 //打开游戏结束界面
+                this.gameState = GameState.READY
+                this.autoState = false;
+                this.adShowingFlag = false;
+                //自动按钮改为手动 
+                this.initButtonState(false);
                 break;
         }
     }
@@ -1590,7 +1606,6 @@ export class EliminateViewComp extends CCComp {
     //寻找最佳位置
     findBestPlacement() {
         const placements = []
-
         // 对每个方块计算所有可能的放置位置和分数
         for (let brickIndex = 0; brickIndex < this.bricksList.length; brickIndex++) {
             const brickData = this.bricksList[brickIndex]
@@ -1765,7 +1780,6 @@ export class EliminateViewComp extends CCComp {
     }
 
 
-
     doubleSpeedOpenSuccess() {
         this._isDoubleSpeed = true;
         //3分钟后关闭
@@ -1781,6 +1795,7 @@ export class EliminateViewComp extends CCComp {
     private restartGame() {
         if (this.gameState === GameState.READY) return;
         this.initData();
+        this.setData();
         this.reopenGrid();
         this.initButtonState(this.autoState);
     }
@@ -1810,9 +1825,6 @@ export class EliminateViewComp extends CCComp {
     }
 
 
-
-
-
     //界面测试
     btn_tongguan() {
         if (DeviceUtil.isNative && DeviceUtil.isAndroid) {

+ 8 - 3
assets/script/game/view/GameOverView.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-27 18:19:53
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-10 15:08:55
+ * @LastEditTime: 2025-04-14 16:38:45
  * @Description: 游戏结束界面
  */
 import { _decorator } from 'cc';
@@ -13,6 +13,7 @@ import { GameEvent } from '../common/config/GameEvent';
 import { smc } from '../common/SingletonModuleComp';
 import { ADHandler } from '../common/manager/ADHandler';
 import { AD_TYPE } from '../common/config/GameDefine';
+import { ServerHandler } from '../common/manager/ServerHandler';
 
 const { ccclass, property } = _decorator;
 
@@ -25,7 +26,8 @@ export class GameOverView extends GameComponent {
 
 
     private btn_restart() {
-        oops.message.dispatchEvent(GameEvent.RestartGame);
+        // oops.message.dispatchEvent(GameEvent.RestartGame);
+        ServerHandler.inst.RestartGame();
         oops.gui.remove(UIID.GameOver);
     }
 
@@ -34,6 +36,9 @@ export class GameOverView extends GameComponent {
         //我这调你登录,你登录后,返回给我,可以登录,我这边加载资源,userinfo-头像,UID nickname,关卡,还有配置,
         //复活
         smc.game.GameModel.viewType = "revive_reward";
-
+        //复活 分数不清零
+        ADHandler.inst.showAd(AD_TYPE.Resurrection);
+        oops.gui.remove(UIID.GameOver);
+        oops.message.dispatchEvent(GameEvent.Resurrection);
     }
 }

+ 3 - 1
assets/script/game/view/GamePassView.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-21 14:43:24
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-11 14:52:51
+ * @LastEditTime: 2025-04-14 17:50:25
  * @Description: 游戏通关弹窗
  */
 import { Label, Node } from 'cc';
@@ -79,6 +79,8 @@ export class GamePassView extends GameComponent {
         oops.gui.remove(UIID.GamePass);
         //给服务器发信息--少量领取
         ServerHandler.inst.getPassRewards();
+
+        //我要不要展示提现点,
     }
 
     //十倍领取

+ 9 - 0
assets/script/game/view/core.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.2.0",
+  "importer": "directory",
+  "imported": true,
+  "uuid": "8336e54b-8e56-4551-b776-3aef3a25e41b",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 921 - 0
assets/script/game/view/core/GameView.ts

@@ -0,0 +1,921 @@
+import { _decorator, Component, Node, find, assetManager, JsonAsset, Prefab, UITransform, Widget, Vec3, instantiate, Sprite, randomRangeInt, EventTouch, Vec2, tween, Label, Color } from 'cc'
+import { oops } from 'db://oops-framework/core/Oops';
+import { ecs } from 'db://oops-framework/libs/ecs/ECS';
+import { CCComp } from 'db://oops-framework/module/common/CCComp';
+import { GameComponent } from 'db://oops-framework/module/common/GameComponent';
+const { ccclass, property } = _decorator;
+
+export enum GameStatus {
+    init,      //初始化
+    running,   //运行中
+    end,       //结束
+    pass        //通关
+}
+
+enum GridStatus {
+    notUse,
+    used,
+}
+
+interface GridDataInterface {
+    name: string,
+    status: GridStatus,
+    gridNode: Node | null,
+    row: number,
+    column: number,
+    gridColorKey: string | null,
+    gridType: number,            //代替gridColorKey
+}
+
+interface GridConfigDataInterface {
+    row: number,
+    column: number,
+}
+
+interface BrickDataInterface {
+    index: number,
+    brickKey: string,
+    rotateFlag: boolean,
+    gridConfig: GridConfigDataInterface[],
+    deg: number,
+    brickNode: Node | null,
+    gridColorKey: string,
+    brickInitPos: Vec3 | null,
+    rotateNode: Node | null,
+    gridType: number,            //gridColorKey
+}
+
+interface EditingDataInterface {
+    brickData: BrickDataInterface,
+    gridList: GridDataInterface[],
+}
+
+@ccclass('GameView')
+export class GameView extends GameComponent {
+
+    row = 8
+    column = 8
+    gridSize = 76.25
+    gridMargin = 1
+    brickNum = 3
+    yOffset = 100
+    aniBrickMove = 0.15    //动画时长
+    aniBrickRotate = 0.1     //
+    aniBrickEliminate = 0.2
+
+    notUseColor = new Color(255, 255, 255, 255)
+    usableColor = new Color(0, 255, 0, 100)
+    unavailableColor = new Color(255, 0, 0, 100)
+    rotateFaultTolerant = 10
+
+    bundleName = 'movebrick'
+    gameConfig = {}
+    gameStatus = GameStatus.init
+    _score = 0
+    editingData: EditingDataInterface = {
+        brickData: null!,
+        gridList: [],
+    }  //修改的数据
+    gridList: GridDataInterface[][] = []
+    bricksList: BrickDataInterface[] = []
+    gridColorList: GridDataInterface[] = []
+    deltaTime: number = 1
+    operateFlag = false
+    touchStartPos = new Vec2()
+    adShowingFlag = false
+
+    canvasNode: Node = null!
+    gridsNode: Node = null!         //网格层
+    bricksNode: Node = null!       //底部方块
+    movingNode: Node = null!       //移动层
+    rotateContainer: Node = null!  //旋转层
+    scoreLabel: Label = null!
+    gameOverPopupNode: Node = null!
+
+    gridPrefab: Prefab = null!     //空格子预制体
+    rotatePrefab: Prefab = null!    //旋转预制体
+    prefabUrlMap = {}  //格子预制体   //所有的格子预制体
+
+    //游戏新增的
+    @property([Prefab])             //所有的预制体,代替prefabUrlMap
+    allBrickList: any[] = [];
+    Lab_target: Label = null!        //目标分数
+    brickListConfig: { bricks?: any } = {}  //方块配置
+    @property(Prefab)
+    gridPb: Prefab = null!   //空格子预制体
+    @property({ type: Prefab, displayName: "旋转标志" })
+    rotatePb: Prefab = null!   //空格子预制体
+
+
+    get score() {
+        return this._score
+    }
+
+    set score(v: number) {
+        this._score = v
+        this.scoreLabel.string = `${this.score}`
+    }
+
+    setAdShowingFlag(v: boolean) {
+        this.adShowingFlag = v
+        // 打开激励视频时暂停背景音乐
+
+    }
+    onLoad() {
+
+        this.gridsNode = this.node.getChildByPath('Scene/Center/gridNode')!
+        this.bricksNode = this.node.getChildByPath('Scene/Bottom/bricksNode')!
+        this.movingNode = this.node.getChildByPath('Scene/moveNode')!
+        this.rotateContainer = this.node.getChildByPath('Scene/rotateNode')!
+        const scoreNode = this.node.getChildByPath('Scene/Top/scoreNode/lab_score')
+        if (!scoreNode) {
+            console.error('Score node not found')
+            return
+        }
+        const label = scoreNode.getComponent(Label)
+        if (!label) {
+            console.error('Label component not found on score node')
+            return
+        }
+        this.scoreLabel = label
+    }
+
+    start() {
+        // 模拟延时
+        this.scheduleOnce(() => {
+            this.loadGameConfig().then(() => {
+                // 生成游戏网格
+                this.generateGrids()
+                this.scheduleOnce(() => {
+                    this.initData()
+                })
+            })
+        }, 1)
+    }
+
+    loadGameConfig() {
+        let json_name: string = "gui/eliminate/config/GridConfig";
+        return new Promise<void>((resolve, reject) => {
+            oops.res.load(json_name, JsonAsset, (err: Error | null, res: any) => {
+                if (res) {
+                    this.brickListConfig = res.json;
+                    resolve();
+                } else {
+                    console.log("JSON数据加载失,请检查文件");
+                    reject(err);
+                }
+            });
+        });
+    }
+
+    setGameStauts(stauts: GameStatus) {
+        if (stauts === this.gameStatus) return
+        this.gameStatus = stauts
+        if (this.gameStatus === GameStatus.init) {
+            // this.gameOverPopupNode.active = false
+        }
+        else if (this.gameStatus === GameStatus.running) {
+            // this.gameOverPopupNode.active = false
+        }
+        else if (this.gameStatus === GameStatus.end) {
+            // this.gameOverPopupNode.active = true
+        }
+    }
+
+    initData() {
+        this.setGameStauts(GameStatus.init)
+        this.score = 0
+        this.gridColorList.length = 0
+        this.operateFlag = false
+        this.adShowingFlag = false
+        this.touchStartPos.set(Vec2.ZERO)
+        this.rotateContainer.destroyAllChildren()
+        // 初始化格子状态
+        for (let rowIndex = 0; rowIndex < this.row; rowIndex++) {
+            for (let columnIndex = 0; columnIndex < this.column; columnIndex++) {
+                this.gridList[rowIndex][columnIndex].status = GridStatus.notUse
+                this.generateGrid(this.gridList[rowIndex][columnIndex])
+            }
+        }
+        // 初始化方块
+        this.bricksNode.destroyAllChildren()
+        this.bricksList.length = 0
+        for (let i = 1; i <= this.brickNum; i++) {
+            this.addBrick(i)
+        }
+
+        this.setGameStauts(GameStatus.running)
+        this.operateFlag = true
+    }
+
+    generateGrids() {
+        this.gridsNode.destroyAllChildren()
+        const transform = this.gridsNode.getComponent(UITransform)
+        if (transform) {
+            transform.setContentSize(
+                this.gridSize * this.column + this.gridMargin * 2,
+                this.gridSize * this.row + this.gridMargin * 2,
+            )
+        }
+
+        for (let rowIndex = 0; rowIndex < this.row; rowIndex++) {
+            this.gridList.push([])
+            for (let columnIndex = 0; columnIndex < this.column; columnIndex++) {
+                let gridData: GridDataInterface = {
+                    name: `Grid-${rowIndex}-${columnIndex}`,
+                    status: GridStatus.notUse,
+                    gridNode: null,
+                    row: rowIndex,
+                    column: columnIndex,
+                    gridColorKey: "null",
+                    gridType: 0
+                }
+                this.gridList[rowIndex].push(gridData)
+                // 节点
+                gridData.gridNode = new Node()
+                this.gridsNode.addChild(gridData.gridNode)
+                gridData.gridNode.name = `Grid-${rowIndex}-${columnIndex}`
+                gridData.gridNode.addComponent(UITransform).setContentSize(this.gridSize, this.gridSize)
+                const gridWidget: Widget = gridData.gridNode.addComponent(Widget)
+                gridWidget.isAlignLeft = true
+                gridWidget.left = this.gridSize * columnIndex + this.gridMargin
+                gridWidget.isAlignBottom = true
+                gridWidget.bottom = this.gridSize * rowIndex + this.gridMargin
+            }
+        }
+    }
+    generateGrid(gridData: GridDataInterface) {
+        if (!gridData.gridNode) return;
+        gridData.gridNode.children.forEach(node => { node.destroy() })
+        let prefab = null
+        if (gridData.status === GridStatus.notUse) {
+            // prefab = this.gridPrefab
+            prefab = this.gridPb;
+        }
+        else if (gridData.status === GridStatus.used) {
+
+            //什么颜色的格子  --可以通过下标获取
+            // prefab = this.prefabUrlMap[this.gameConfig['gridColor'][gridData.gridColorKey]['prefabUrl']]
+            prefab = this.allBrickList[gridData.gridType];
+
+        }
+        const node = instantiate(prefab);
+        if (!node) return;
+        if (gridData.status === GridStatus.notUse) {
+            node.getComponent(Sprite).color = this.notUseColor
+        }
+        gridData.gridNode.addChild(node)
+        node.getComponent(UITransform).setContentSize(
+            this.gridSize - this.gridMargin * 2,
+            this.gridSize - this.gridMargin * 2,
+        )
+        node.setPosition(Vec3.ZERO)
+    }
+
+    generateBrick(brickKey: string, gridColorKey: string, gridType: number) {
+        const brickConfig = this.brickListConfig['bricks'][brickKey]
+        let rowMin = 0
+        let rowMax = 0
+        let columnMin = 0
+        let columnMax = 0
+        brickConfig['gridConfig'].forEach((gridConfigData: GridConfigDataInterface) => {
+            if (gridConfigData.row < rowMin) {
+                rowMin = gridConfigData.row
+            }
+            else if (gridConfigData.row > rowMax) {
+                rowMax = gridConfigData.row
+            }
+            if (gridConfigData.column < columnMin) {
+                columnMin = gridConfigData.column
+            }
+            else if (gridConfigData.column > columnMax) {
+                columnMax = gridConfigData.column
+            }
+        })
+        const rowNum = (rowMax - rowMin + 1)
+        const columnNum = (columnMax - columnMin + 1)
+        // 生成独立的方块节点
+        const brickNode = new Node()
+        brickNode.name = brickKey
+        const transformCom: UITransform = brickNode.addComponent(UITransform)
+        transformCom.setContentSize(
+            this.gridSize * columnNum,
+            this.gridSize * rowNum
+        )
+        transformCom.setAnchorPoint(0.5, 0.5)
+        // const gridPrefab = this.prefabUrlMap[this.gameConfig['gridColor'][gridColorKey]['prefabUrl']]
+        const gridPrefab = this.allBrickList[gridType];
+        //通过配置初始化
+        brickConfig['gridConfig'].forEach((gridConfigData: GridConfigDataInterface) => {
+            const gridNode = new Node()
+            gridNode.name = 'grid'
+            brickNode.addChild(gridNode)
+            gridNode.addComponent(UITransform).setContentSize(this.gridSize, this.gridSize)
+            const gridWidget: Widget = gridNode.addComponent(Widget)
+            gridWidget.isAlignLeft = true
+            gridWidget.left = this.gridSize * gridConfigData.column - this.gridSize * columnMin
+            gridWidget.isAlignBottom = true
+            gridWidget.bottom = this.gridSize * gridConfigData.row - this.gridSize * rowMin
+            const node = instantiate(gridPrefab)
+            gridNode.addChild(node)
+            node.getComponent(UITransform).setContentSize(
+                this.gridSize - this.gridMargin * 2,
+                this.gridSize - this.gridMargin * 2,
+            )
+
+
+
+            node.setPosition(Vec3.ZERO)
+            node.on(Node.EventType.TOUCH_START, (event: EventTouch) => {
+                event.preventSwallow = true;
+            }, this);
+            node.on(Node.EventType.TOUCH_MOVE, (event: EventTouch) => {
+                event.preventSwallow = true;
+            }, this);
+            node.on(Node.EventType.TOUCH_END, (event: EventTouch) => {
+                event.preventSwallow = true;
+            }, this);
+        })
+
+        return brickNode
+    }
+    addBrick(index: number) {
+        const bricks = this.brickListConfig.bricks || {};
+        // const gridColors = this.gameConfig.gridColor || {};
+        //获取方块的类型
+        const brickKey = Object.keys(bricks)[randomRangeInt(0, Object.keys(bricks).length)];
+        //获取方块的颜色随机下标
+        // const gridColorKey = Object.keys(gridColors)[randomRangeInt(0, Object.keys(gridColors).length)];
+
+        const gridColorKey = "GridColor1";
+        //通过Key获取具体配置
+        const brickConfig = bricks[brickKey];
+        const gridType = randomRangeInt(0, this.allBrickList.length);
+        const brickData: BrickDataInterface = {
+            index,
+            brickKey,
+            rotateFlag: brickConfig['rotateFlag'],
+            gridConfig: brickConfig['gridConfig'],
+            deg: 0,
+            brickNode: null,
+            gridColorKey,
+            brickInitPos: null,
+            rotateNode: null,
+            gridType: 0
+        }
+        this.bricksList.push(brickData)
+        // 生成方块
+        const brickNode = this.generateBrick(brickKey, gridColorKey, gridType)
+        this.bricksNode.addChild(brickNode)
+        brickData.brickNode = brickNode
+        // 方块间隔
+        let offset = 220
+        if (this.brickNum % 2 === 1) {
+            const middleNum = Math.floor(this.brickNum / 2) + 1
+            if (index < middleNum) {
+                offset = - offset
+            }
+            else if (index === middleNum) {
+                offset = 0
+            }
+        }
+        if (brickData && brickData.brickNode) {
+            brickData.brickNode.setPosition(offset, 0)
+            brickData.brickNode.scale_x = 0.6;
+            brickData.brickNode.scale_y = 0.6;
+            brickData.brickInitPos = brickData.brickNode.getWorldPosition()
+        }
+        // 添加旋转图标
+        if (brickData.rotateFlag) {
+            // brickData.rotateNode = instantiate(this.rotatePrefab)
+            brickData.rotateNode = instantiate(this.rotatePb);
+            this.rotateContainer.addChild(brickData.rotateNode)
+            brickData.rotateNode.setWorldPosition(brickNode.getWorldPosition())
+        }
+        // 方块添加事件
+        this.brickAddEvent(brickData)
+    }
+
+    brickAddEvent(brickData: BrickDataInterface) {
+        const brickNode = brickData.brickNode
+        if (!brickNode) return
+        // 触摸时
+        brickNode.on(Node.EventType.TOUCH_START, (event: EventTouch) => {
+            if (this.adShowingFlag || !this.operateFlag) return
+
+            this.editingData.brickData = brickData
+            this.editingData.gridList.length = 0
+            // 记录开始触摸的位置
+            this.touchStartPos.set(event.getUILocation())
+            // 添加到移动节点里进行移动
+            const pos = brickNode.getWorldPosition()
+            brickNode.setParent(this.movingNode)
+            brickNode.setWorldPosition(pos)
+
+            const index = this.bricksList.findIndex(data => data === brickData)
+            if (index > -1) {
+                this.editingData.brickData = this.bricksList.splice(index, 1)[0]
+            } else {
+                console.error("bricksList not find brickData:", brickData)
+            }
+        })
+        // 触摸移动时
+        brickNode.on(Node.EventType.TOUCH_MOVE, (event: EventTouch) => {
+            if (this.adShowingFlag || !this.operateFlag) return
+
+            const movePos: Vec2 = event.getUILocation().subtract(this.touchStartPos)
+            // 挪动很小时,不移动方块组合
+            if (movePos.length() <= this.rotateFaultTolerant) {
+                return
+            }
+            // 隐藏旋转节点
+            if (this.editingData.brickData?.rotateFlag && this.editingData.brickData.rotateNode) {
+                this.editingData.brickData.rotateNode.active = false
+            }
+            // 格子颜色恢复
+            this.gridColorRecovery()
+            // 移动
+            brickNode.setWorldPosition(event.getUILocation().toVec3().add3f(0, this.yOffset, 0))
+            // 每次移动重置数据
+            this.editingData.gridList.length = 0
+            // 实时获取方块位置判断在哪个格子上
+            const tempGridList: GridDataInterface[] = []
+            brickNode.children.forEach((brickGridNode) => {
+                const brickGridPos = brickGridNode.getWorldPosition()
+                let gridData: GridDataInterface | null = null
+                for (let rowIndex = 0; rowIndex < this.row && gridData === null; rowIndex++) {
+                    for (let columnIndex = 0; columnIndex < this.column && gridData === null; columnIndex++) {
+                        const nowGridData = this.gridList[rowIndex][columnIndex]
+                        if (!nowGridData?.gridNode) continue
+                        const gridPos = nowGridData.gridNode.getWorldPosition()
+                        if (Vec3.distance(gridPos, brickGridPos) <= (this.gridSize / 2 - this.gridMargin)) {
+                            gridData = nowGridData
+                        }
+                    }
+                }
+                if (gridData === null) return
+                tempGridList.push(gridData)
+            })
+            // 检查整体情况
+            let checkFlag = false
+            if (
+                tempGridList.length === brickData.gridConfig.length &&
+                tempGridList.filter(d => d.status === GridStatus.notUse).length === brickData.gridConfig.length
+            ) {
+                checkFlag = true
+                tempGridList.forEach((gridData) => {
+                    this.editingData.gridList.push(gridData)
+                })
+            }
+            // 格子给用户提示
+            tempGridList.forEach((gridData) => {
+                if (gridData.status !== GridStatus.notUse || !gridData.gridNode) return
+                const sprite = gridData.gridNode.children[0]?.getComponent(Sprite)
+                if (sprite) {
+                    sprite.color = checkFlag ? this.usableColor : this.unavailableColor
+                    // 用于恢复格子
+                    this.gridColorList.push(gridData)
+                }
+            })
+        })
+        // 触摸松开后
+        brickNode.on(Node.EventType.TOUCH_END, this.brickTouchEnd, this)
+        brickNode.on(Node.EventType.TOUCH_CANCEL, this.brickTouchEnd, this)
+    }
+
+    brickTouchEnd(event: EventTouch) {
+        if (this.adShowingFlag || !this.operateFlag) return
+        this.operateFlag = false
+        // 单击旋转
+        if (
+            this.editingData.brickData.rotateFlag &&
+            event.getUILocation().subtract(this.touchStartPos).length() <= this.rotateFaultTolerant
+        ) {
+            const brickData = this.editingData.brickData
+            // 方块放回待选区
+            if (brickData.brickNode && brickData.brickInitPos) {
+                this.bricksList.push(brickData)
+                this.bricksNode.addChild(brickData.brickNode)
+                brickData.brickNode.setWorldPosition(brickData.brickInitPos)
+                // 旋转
+                this.brickGridRotate(brickData).then(() => {
+                    this.operateFlag = true
+                })
+            }
+        }
+        // 方块到格子
+        else if (this.editingData.brickData && this.editingData.gridList.length > 0) {
+            // 修改格子
+            this.editingData.gridList.forEach((gridData) => {
+                gridData.status = GridStatus.used
+                gridData.gridColorKey = this.editingData.brickData.gridColorKey
+                this.generateGrid(gridData)
+            })
+            // 销毁方块
+            if (this.editingData.brickData.brickNode) {
+                this.editingData.brickData.brickNode.destroy()
+            }
+            // 销毁旋转节点
+            if (this.editingData.brickData.rotateFlag && this.editingData.brickData.rotateNode) {
+                this.editingData.brickData.rotateNode.destroy()
+            }
+            // 新增方块
+            this.addBrick(this.editingData.brickData.index)
+            this.scheduleOnce(() => {
+                // 格子消除
+                this.gridEliminate().then(() => {
+                    // 检查方块是否还能消除格子
+                    this.prompt(false).then((promptFlag: boolean) => {
+                        if (!promptFlag) {
+                            this.gameOver()
+                        }
+                        this.operateFlag = true
+                    })
+                })
+            })
+        }
+        // 方块回到待选区
+        else {
+            const brickData = this.editingData.brickData
+            this.bricksList.push(brickData)
+            this.operateFlag = false
+            // 回弹动画
+            if (brickData.brickNode) {
+                const pos = this.editingData.brickData.brickInitPos
+                if (!pos) {
+                    return;
+                }
+                tween(brickData.brickNode)
+                    .to(this.aniBrickMove, { worldPosition: pos })
+                    .call(() => {
+                        if (brickData.brickNode && brickData.brickInitPos && brickData.rotateNode) {
+                            this.bricksNode.addChild(brickData.brickNode)
+                            brickData.brickNode.setWorldPosition(brickData.brickInitPos)
+                            if (brickData.rotateFlag) {
+                                brickData.rotateNode.active = true
+                            }
+                            this.operateFlag = true
+                        }
+                    })
+                    .start()
+
+            }
+
+        }
+        // 格子颜色恢复
+        this.gridColorRecovery()
+    }
+
+
+    //格子颜色恢复
+    gridColorRecovery() {
+        while (this.gridColorList.length > 0) {
+            const gridData = this.gridColorList.pop()
+            if (gridData?.gridNode && gridData.status === GridStatus.notUse) {
+                const sprite = gridData.gridNode.children[0]?.getComponent(Sprite)
+                if (sprite) {
+                    sprite.color = this.notUseColor
+                }
+            }
+        }
+    }
+
+    nextGridRotate(gridConfig: GridConfigDataInterface[], deg: number) {
+        const newGridConfig: GridConfigDataInterface[] = []
+        // 顺时针旋转
+        let newDeg = deg - 90
+        gridConfig.forEach((gridConfigData) => {
+            // 例如(1,2) => (-2,1),可以画图分析
+            newGridConfig.push({
+                row: -gridConfigData.column,
+                column: gridConfigData.row
+            })
+        })
+        return { gridConfig: newGridConfig, deg: newDeg }
+    }
+
+    'brickGridRotate'(brickData: BrickDataInterface) {
+        return new Promise((resolve, reject) => {
+            // this.audioManager.playRotate()
+            const next = this.nextGridRotate(brickData.gridConfig, brickData.deg)
+            brickData.deg = next.deg
+            brickData.gridConfig = next.gridConfig
+
+            if (brickData.brickNode) {
+                tween(brickData.brickNode)
+                    .to(this.aniBrickRotate, { angle: next.deg })
+                    .call(() => {
+                        resolve(true)
+                    }).start()
+            }
+
+        })
+    }
+
+    gridEliminateCheck(gridList: GridDataInterface[][]) {
+        const gridEliminateList: GridDataInterface[] = []
+        let eliminateRowNum = 0
+        let eliminateColumnNum = 0
+        // 行检查
+        for (let rowIndex = 0; rowIndex < this.row; rowIndex++) {
+            const rowData = gridList[rowIndex]
+            if (rowData.every(gridData => gridData.status === GridStatus.used)) {
+                rowData.forEach(gridData => {
+                    if (gridEliminateList.findIndex(data => data === gridData) < 0) {
+                        gridEliminateList.push(gridData)
+                    }
+                })
+                eliminateRowNum += 1
+            }
+        }
+        // 列检查
+        for (let columnIndex = 0; columnIndex < this.column; columnIndex++) {
+            if (gridList.every(rowData => rowData[columnIndex].status === GridStatus.used)) {
+                gridList.forEach(rowData => {
+                    const gridData = rowData[columnIndex]
+                    if (gridEliminateList.findIndex(data => data === gridData) < 0) {
+                        gridEliminateList.push(gridData)
+                    }
+                })
+                eliminateColumnNum += 1
+            }
+        }
+        return {
+            gridEliminateList,
+            eliminateRowNum,
+            eliminateColumnNum,
+        }
+    }
+
+    // 消除
+    gridEliminate() {
+        return new Promise((resolve, reject) => {
+            const d = this.gridEliminateCheck(this.gridList)
+            const gridEliminateList = d.gridEliminateList
+            const eliminateRowNum = d.eliminateRowNum
+            const eliminateColumnNum = d.eliminateColumnNum
+            // 无行可消除
+            if (gridEliminateList.length < 1) {
+                resolve(false)
+                return
+            }
+            // 消除格子
+            gridEliminateList.forEach((gridData) => {
+                if (gridData.gridNode) {
+                    tween(gridData.gridNode.children[0])
+                        .to(this.aniBrickEliminate, { scale: new Vec3(0.5, 0.5) })
+                        .call(() => {
+                            gridData.status = GridStatus.notUse
+                            this.generateGrid(gridData)
+                        })
+                        .start()
+                }
+            })
+            // 音效
+            // this.audioManager.playEliminate()
+            this.scheduleOnce(() => {
+                // 成绩
+                let score = 0
+                for (let i = 1; i <= eliminateRowNum; i++) {
+                    score += this.column * i
+                }
+                for (let i = 1; i <= eliminateColumnNum; i++) {
+                    score += this.row * i
+                }
+                this.score += score
+                resolve(true)
+            }, 0.2)
+        })
+    }
+
+    gameOver() {
+        // this.audioManager.playGameOver()
+        this.setGameStauts(GameStatus.end)
+    }
+
+    moveIf(row: number, column: number, gridConfig: GridConfigDataInterface[]) {
+        let moveFlag = true
+        for (let i = 0; i < gridConfig.length; i++) {
+            const gridConfigData = gridConfig[i]
+            const gridI = row + gridConfigData.row
+            const gridJ = column + gridConfigData.column
+            // 边界判断
+            if (
+                gridI < 0 ||
+                gridI > this.row - 1 ||
+                gridJ < 0 ||
+                gridJ > this.column - 1
+            ) {
+                moveFlag = false
+                break
+            }
+            // 已用
+            else if (this.gridList[gridI][gridJ].status === GridStatus.used) {
+                moveFlag = false
+                break
+            }
+        }
+        return moveFlag
+    }
+
+    copyGridList() {
+        const gridList: GridDataInterface[][] = []
+        for (let rowIndex = 0; rowIndex < this.row; rowIndex++) {
+            gridList.push([])
+            for (let columnIndex = 0; columnIndex < this.column; columnIndex++) {
+                const gridData = this.gridList[rowIndex][columnIndex]
+                gridList[rowIndex].push({
+                    name: gridData.name,
+                    status: gridData.status,
+                    gridNode: null,
+                    row: gridData.row,
+                    column: gridData.column,
+                    gridColorKey: gridData.gridColorKey,
+                    gridType: gridData.gridType
+                })
+            }
+        }
+        return gridList
+    }
+
+    prompt(tipFlag = true) {
+        return new Promise((resolve, reject) => {
+            const gridPromptList: GridDataInterface[] = []
+            let moveFlag = false
+            // 找方块可消除位置
+            for (let rowIndex = 0; rowIndex < this.row && !moveFlag; rowIndex++) {
+                for (let columnIndex = 0; columnIndex < this.column && !moveFlag; columnIndex++) {
+                    const gridData = this.gridList[rowIndex][columnIndex]
+                    if (gridData.status !== GridStatus.notUse) continue
+                    // 方块不旋转检测是否能放
+                    for (let brickI = 0; brickI < this.bricksList.length && !moveFlag; brickI++) {
+                        const brickData = this.bricksList[brickI]
+                        if (this.moveIf(rowIndex, columnIndex, brickData.gridConfig)) {
+                            // 复制整体网格,以方块设置网格状态
+                            const gridList = this.copyGridList()
+                            brickData.gridConfig.forEach((gridConfigData) => {
+                                gridList[gridConfigData.row + rowIndex][gridConfigData.column + columnIndex].status = GridStatus.used
+                            })
+                            // 检查复制的整体网格是否有可消除
+                            if (this.gridEliminateCheck(gridList).gridEliminateList.length > 0) {
+                                moveFlag = true
+                                brickData.gridConfig.forEach((gridConfigData) => {
+                                    gridPromptList.push(this.gridList[gridConfigData.row + rowIndex][gridConfigData.column + columnIndex])
+                                })
+                            }
+                        }
+                    }
+                    // 方块旋转检测是否能放
+                    for (let brickI = 0; brickI < this.bricksList.length && !moveFlag; brickI++) {
+                        const brickData = this.bricksList[brickI]
+                        if (!brickData.rotateFlag) continue
+                        let gridConfig = brickData.gridConfig
+                        let deg = brickData.deg
+                        // 获得旋转的方块网格配置
+                        for (let count = 1; count <= 3 && !moveFlag; count++) {
+                            const next = this.nextGridRotate(gridConfig, deg)
+                            if (this.moveIf(rowIndex, columnIndex, next.gridConfig)) {
+                                // 复制整体网格,以方块设置网格状态
+                                const gridList = this.copyGridList()
+                                next.gridConfig.forEach((gridConfigData) => {
+                                    gridList[gridConfigData.row + rowIndex][gridConfigData.column + columnIndex].status = GridStatus.used
+                                })
+                                // 检查复制的整体网格是否有可消除
+                                if (this.gridEliminateCheck(gridList).gridEliminateList.length > 0) {
+                                    moveFlag = true
+                                    next.gridConfig.forEach((gridConfigData) => {
+                                        gridPromptList.push(this.gridList[gridConfigData.row + rowIndex][gridConfigData.column + columnIndex])
+                                    })
+                                }
+                            }
+                            gridConfig = next.gridConfig
+                            deg = next.deg
+                        }
+                    }
+                }
+            }
+            // 找方块可放置位置
+            for (let rowIndex = 0; rowIndex < this.row && !moveFlag; rowIndex++) {
+                for (let columnIndex = 0; columnIndex < this.column && !moveFlag; columnIndex++) {
+                    const gridData = this.gridList[rowIndex][columnIndex]
+                    if (gridData.status !== GridStatus.notUse) continue
+                    // 方块不旋转检测是否能放
+                    for (let brickI = 0; brickI < this.bricksList.length && !moveFlag; brickI++) {
+                        const brickData = this.bricksList[brickI]
+                        if (this.moveIf(rowIndex, columnIndex, brickData.gridConfig)) {
+                            moveFlag = true
+                            brickData.gridConfig.forEach((gridConfigData) => {
+                                gridPromptList.push(this.gridList[gridConfigData.row + rowIndex][gridConfigData.column + columnIndex])
+                            })
+                        }
+                    }
+                    // 方块旋转检测是否能放
+                    for (let brickI = 0; brickI < this.bricksList.length && !moveFlag; brickI++) {
+                        const brickData = this.bricksList[brickI]
+                        if (!brickData.rotateFlag) continue
+                        let gridConfig = brickData.gridConfig
+                        let deg = brickData.deg
+                        for (let count = 1; count <= 3 && !moveFlag; count++) {
+                            const next = this.nextGridRotate(gridConfig, deg)
+                            if (this.moveIf(rowIndex, columnIndex, next.gridConfig)) {
+                                moveFlag = true
+                                next.gridConfig.forEach((gridConfigData) => {
+                                    gridPromptList.push(this.gridList[gridConfigData.row + rowIndex][gridConfigData.column + columnIndex])
+                                })
+                            }
+                            gridConfig = next.gridConfig
+                            deg = next.deg
+                        }
+                    }
+                }
+            }
+
+            if (gridPromptList.length < 1) {
+                resolve(false)
+                return
+            }
+            if (!tipFlag) {
+                resolve(true)
+                return
+            }
+            // 提示用户(网格变绿)
+            gridPromptList.forEach((gridData) => {
+                if (gridData.gridNode) {
+                    const sprite = gridData.gridNode.children[0]?.getComponent(Sprite)
+                    if (sprite) {
+                        sprite.color = this.usableColor
+                        // 用于恢复格子
+                        this.gridColorList.push(gridData)
+                    }
+                }
+            })
+            resolve(true)
+        })
+    }
+
+
+    //重新开始
+    onRefreshBtnClick() {
+        if (
+            this.gameStatus !== GameStatus.running ||
+            !this.operateFlag ||
+            this.adShowingFlag
+        ) return
+
+        this.setAdShowingFlag(true)
+        this.bricksNode.destroyAllChildren()
+        this.rotateContainer.destroyAllChildren()
+        this.bricksList.length = 0
+        for (let i = 1; i <= this.brickNum; i++) {
+            this.addBrick(i)
+        }
+        // 恢复格子颜色
+        this.gridColorRecovery()
+        this.setAdShowingFlag(false)
+
+    }
+
+    //--复活
+    onPromptBtnClick() {
+        if (
+            this.gameStatus !== GameStatus.running ||
+            !this.operateFlag ||
+            this.adShowingFlag
+        ) return
+
+        // 先检查是否死局
+        this.prompt(false).then((flag) => {
+            if (!flag) {
+                this.gameOver()
+                return
+            }
+            // 非死局,打开广告
+            this.setAdShowingFlag(true)
+            // SDKManager.showVideoAd().then((isEnded: boolean) => {
+            //     if (isEnded) {
+            //         this.gridColorRecovery()
+            //         this.prompt()
+            //     }
+            //     this.setAdShowingFlag(false)
+            // }).catch((err) => {
+            //     console.error('onPromptBtnClick', err)
+            //     this.setAdShowingFlag(false)
+            // })
+        })
+    }
+
+    //再来一次
+    onAgainBtnClick() {
+        if (!this.operateFlag) return
+
+        this.initData()
+    }
+
+    //确认游戏
+    onContinueBtnClick() {
+        this.setGameStauts(GameStatus.running)
+    }
+
+}
+
+

+ 9 - 0
assets/script/game/view/core/GameView.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.24",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "362651a5-a95e-4b3a-b54b-deccbf778a76",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}