소스 검색

Merge branch 'master' of http://120.92.132.192:23541/TDGame/TDGameClient3D

cailianda 4 년 전
부모
커밋
b8d03e2b8c

+ 24 - 7
assets/d3d/gunFire/zhuodan.fbx.meta

@@ -5,6 +5,23 @@
   "uuid": "7c735b05-1052-417a-bab4-49dbefdbb9fc",
   "files": [],
   "subMetas": {
+    "a55e7": {
+      "importer": "gltf-embeded-image",
+      "uuid": "7c735b05-1052-417a-bab4-49dbefdbb9fc@a55e7",
+      "displayName": "",
+      "id": "a55e7",
+      "name": "5555.png.image",
+      "ver": "1.0.2",
+      "imported": true,
+      "files": [
+        ".png",
+        ".json"
+      ],
+      "subMetas": {},
+      "userData": {
+        "gltfIndex": 0
+      }
+    },
     "e22fe": {
       "importer": "gltf-mesh",
       "uuid": "7c735b05-1052-417a-bab4-49dbefdbb9fc@e22fe",
@@ -80,12 +97,12 @@
         "events": []
       }
     },
-    "a55e7": {
+    "adacb": {
       "importer": "gltf-embeded-image",
-      "uuid": "7c735b05-1052-417a-bab4-49dbefdbb9fc@a55e7",
+      "uuid": "7c735b05-1052-417a-bab4-49dbefdbb9fc@adacb",
       "displayName": "",
-      "id": "a55e7",
-      "name": "5555.png.image",
+      "id": "adacb",
+      "name": "file2.image",
       "ver": "1.0.2",
       "imported": true,
       "files": [
@@ -118,7 +135,7 @@
         "premultiplyAlpha": false,
         "anisotropy": 1,
         "isUuid": true,
-        "imageUuidOrDatabaseUri": "7c735b05-1052-417a-bab4-49dbefdbb9fc@a55e7"
+        "imageUuidOrDatabaseUri": "7c735b05-1052-417a-bab4-49dbefdbb9fc@adacb"
       }
     },
     "826f3": {
@@ -141,8 +158,8 @@
   "userData": {
     "imageMetas": [
       {
-        "name": "5555.png",
-        "uri": "7c735b05-1052-417a-bab4-49dbefdbb9fc@a55e7"
+        "name": "file2",
+        "uri": "7c735b05-1052-417a-bab4-49dbefdbb9fc@adacb"
       }
     ],
     "animationImportSettings": [

+ 14 - 14
assets/resources/ui/AutoSyntheticUI.prefab

@@ -1315,8 +1315,8 @@
       "__id__": 1
     },
     "component": "",
-    "_componentId": "15ec3t8BJRJTpilb3tkiwVQ",
-    "handler": "PlayNextLevel",
+    "_componentId": "8af31Ok7EZO+7PG8Qjo9nfp",
+    "handler": "VideoButtonClickHandler",
     "customEventData": ""
   },
   {
@@ -1788,8 +1788,8 @@
       "__id__": 1
     },
     "component": "",
-    "_componentId": "15ec3t8BJRJTpilb3tkiwVQ",
-    "handler": "PlayNextLevel",
+    "_componentId": "8af31Ok7EZO+7PG8Qjo9nfp",
+    "handler": "DiamondButtonClickHandler",
     "customEventData": ""
   },
   {
@@ -2134,10 +2134,12 @@
   },
   {
     "__type__": "cc.ClickEvent",
-    "target": null,
+    "target": {
+      "__id__": 1
+    },
     "component": "",
-    "_componentId": "37fe6LfvF5F0pkrzYdfUpH2",
-    "handler": "BackButtonClick",
+    "_componentId": "8af31Ok7EZO+7PG8Qjo9nfp",
+    "handler": "CloseButtonClickHandler",
     "customEventData": ""
   },
   {
@@ -2367,18 +2369,16 @@
     "_id": ""
   },
   {
-    "__type__": "15ec3t8BJRJTpilb3tkiwVQ",
-    "_name": "GameOverUI<GameOverMediator>",
+    "__type__": "8af31Ok7EZO+7PG8Qjo9nfp",
+    "_name": "",
     "_objFlags": 0,
     "node": {
       "__id__": 1
     },
     "_enabled": true,
-    "WinGroup": null,
-    "WinAwardLabel": null,
-    "DefeatedGroup": null,
-    "WinBackButton": null,
-    "DefeatedBackButton": null,
+    "diamondLabel": {
+      "__id__": 47
+    },
     "_id": ""
   },
   {

+ 82 - 65
assets/resources/ui/PrepareUI.prefab

@@ -47,26 +47,26 @@
         "__id__": 202
       },
       {
-        "__id__": 253
+        "__id__": 254
       },
       {
-        "__id__": 261
+        "__id__": 262
       }
     ],
     "_active": true,
     "_components": [
-      {
-        "__id__": 266
-      },
       {
         "__id__": 267
       },
       {
         "__id__": 268
+      },
+      {
+        "__id__": 269
       }
     ],
     "_prefab": {
-      "__id__": 269
+      "__id__": 270
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -3698,7 +3698,7 @@
         "__id__": 124
       }
     ],
-    "_active": false,
+    "_active": true,
     "_components": [
       {
         "__id__": 128
@@ -6183,17 +6183,17 @@
         "__id__": 221
       },
       {
-        "__id__": 234
+        "__id__": 235
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 251
+        "__id__": 252
       }
     ],
     "_prefab": {
-      "__id__": 252
+      "__id__": 253
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -6847,7 +6847,7 @@
         "__id__": 226
       }
     ],
-    "_active": false,
+    "_active": true,
     "_components": [
       {
         "__id__": 230
@@ -6860,7 +6860,7 @@
       }
     ],
     "_prefab": {
-      "__id__": 233
+      "__id__": 234
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -7195,7 +7195,11 @@
       "__id__": 221
     },
     "_enabled": true,
-    "clickEvents": [],
+    "clickEvents": [
+      {
+        "__id__": 233
+      }
+    ],
     "_interactable": true,
     "_transition": 2,
     "_normalColor": {
@@ -7245,6 +7249,16 @@
     },
     "_id": ""
   },
+  {
+    "__type__": "cc.ClickEvent",
+    "target": {
+      "__id__": 1
+    },
+    "component": "",
+    "_componentId": "8fc93vzZ1xF6qpWn8Qq53+4",
+    "handler": "AccelerateButtonClickHandler",
+    "customEventData": ""
+  },
   {
     "__type__": "cc.PrefabInfo",
     "root": {
@@ -7269,29 +7283,29 @@
     },
     "_children": [
       {
-        "__id__": 235
+        "__id__": 236
       },
       {
-        "__id__": 239
+        "__id__": 240
       },
       {
-        "__id__": 243
+        "__id__": 244
       }
     ],
     "_active": true,
     "_components": [
-      {
-        "__id__": 247
-      },
       {
         "__id__": 248
       },
       {
         "__id__": 249
+      },
+      {
+        "__id__": 250
       }
     ],
     "_prefab": {
-      "__id__": 250
+      "__id__": 251
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -7326,20 +7340,20 @@
     "_name": "Sprite",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 234
+      "__id__": 235
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 236
+        "__id__": 237
       },
       {
-        "__id__": 237
+        "__id__": 238
       }
     ],
     "_prefab": {
-      "__id__": 238
+      "__id__": 239
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -7374,7 +7388,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 235
+      "__id__": 236
     },
     "_enabled": true,
     "_priority": 0,
@@ -7395,7 +7409,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 235
+      "__id__": 236
     },
     "_enabled": true,
     "_srcBlendFactor": 2,
@@ -7446,20 +7460,20 @@
     "_name": "PriceLabel",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 234
+      "__id__": 235
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 240
+        "__id__": 241
       },
       {
-        "__id__": 241
+        "__id__": 242
       }
     ],
     "_prefab": {
-      "__id__": 242
+      "__id__": 243
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -7494,7 +7508,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 239
+      "__id__": 240
     },
     "_enabled": true,
     "_priority": 0,
@@ -7515,7 +7529,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 239
+      "__id__": 240
     },
     "_enabled": true,
     "_srcBlendFactor": 2,
@@ -7566,20 +7580,20 @@
     "_name": "GunIcon",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 234
+      "__id__": 235
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 244
+        "__id__": 245
       },
       {
-        "__id__": 245
+        "__id__": 246
       }
     ],
     "_prefab": {
-      "__id__": 246
+      "__id__": 247
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -7614,7 +7628,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 243
+      "__id__": 244
     },
     "_enabled": true,
     "_priority": 0,
@@ -7635,7 +7649,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 243
+      "__id__": 244
     },
     "_enabled": true,
     "_srcBlendFactor": 2,
@@ -7686,7 +7700,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 234
+      "__id__": 235
     },
     "_enabled": true,
     "_priority": 0,
@@ -7707,7 +7721,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 234
+      "__id__": 235
     },
     "_enabled": true,
     "_srcBlendFactor": 2,
@@ -7743,7 +7757,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 234
+      "__id__": 235
     },
     "_enabled": true,
     "clickEvents": [],
@@ -7792,7 +7806,7 @@
     "_duration": 0.1,
     "_zoomScale": 1.2,
     "_target": {
-      "__id__": 234
+      "__id__": 235
     },
     "_id": ""
   },
@@ -7856,20 +7870,20 @@
     },
     "_children": [
       {
-        "__id__": 254
+        "__id__": 255
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 258
+        "__id__": 259
       },
       {
-        "__id__": 259
+        "__id__": 260
       }
     ],
     "_prefab": {
-      "__id__": 260
+      "__id__": 261
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -7904,20 +7918,20 @@
     "_name": "WeaponIcon",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 253
+      "__id__": 254
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 255
+        "__id__": 256
       },
       {
-        "__id__": 256
+        "__id__": 257
       }
     ],
     "_prefab": {
-      "__id__": 257
+      "__id__": 258
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -7952,7 +7966,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 254
+      "__id__": 255
     },
     "_enabled": true,
     "_priority": 0,
@@ -7973,7 +7987,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 254
+      "__id__": 255
     },
     "_enabled": true,
     "_srcBlendFactor": 2,
@@ -8024,7 +8038,7 @@
     "_name": "DragLayer<UITransformComponent>",
     "_objFlags": 0,
     "node": {
-      "__id__": 253
+      "__id__": 254
     },
     "_enabled": true,
     "_priority": 0,
@@ -8045,7 +8059,7 @@
     "_name": "DragLayer<WidgetComponent>",
     "_objFlags": 0,
     "node": {
-      "__id__": 253
+      "__id__": 254
     },
     "_enabled": true,
     "_alignFlags": 45,
@@ -8093,18 +8107,18 @@
     "_children": [],
     "_active": false,
     "_components": [
-      {
-        "__id__": 262
-      },
       {
         "__id__": 263
       },
       {
         "__id__": 264
+      },
+      {
+        "__id__": 265
       }
     ],
     "_prefab": {
-      "__id__": 265
+      "__id__": 266
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -8139,7 +8153,7 @@
     "_name": "Design<UITransformComponent>",
     "_objFlags": 0,
     "node": {
-      "__id__": 261
+      "__id__": 262
     },
     "_enabled": true,
     "_priority": 0,
@@ -8160,7 +8174,7 @@
     "_name": "Design<SpriteComponent>",
     "_objFlags": 0,
     "node": {
-      "__id__": 261
+      "__id__": 262
     },
     "_enabled": true,
     "_srcBlendFactor": 2,
@@ -8196,7 +8210,7 @@
     "_name": "Design<UIOpacityComponent>",
     "_objFlags": 0,
     "node": {
-      "__id__": 261
+      "__id__": 262
     },
     "_enabled": true,
     "_opacity": 80,
@@ -8274,6 +8288,9 @@
       "__id__": 1
     },
     "_enabled": true,
+    "bufferNode": {
+      "__id__": 123
+    },
     "glodLabel": {
       "__id__": 78
     },
@@ -8296,16 +8313,16 @@
       "__id__": 148
     },
     "quickBuyButton": {
-      "__id__": 249
+      "__id__": 250
     },
     "quickBuyWeaponIcon": {
-      "__id__": 245
+      "__id__": 246
     },
     "quickBuyWeaponPriceLabel": {
-      "__id__": 241
+      "__id__": 242
     },
     "weaponDragIcon": {
-      "__id__": 256
+      "__id__": 257
     },
     "deleteWeaponNode": {
       "__id__": 203

+ 99 - 98
assets/resources/ui/components/ShopListItemRender.prefab

@@ -22,9 +22,6 @@
       {
         "__id__": 7
       },
-      {
-        "__id__": 12
-      },
       {
         "__id__": 17
       },
@@ -248,25 +245,80 @@
     "_parent": {
       "__id__": 1
     },
-    "_children": [],
+    "_children": [
+      {
+        "__id__": 8
+      }
+    ],
     "_active": true,
     "_components": [
       {
-        "__id__": 8
+        "__id__": 13
+      },
+      {
+        "__id__": 14
       },
+      {
+        "__id__": 15
+      }
+    ],
+    "_prefab": {
+      "__id__": 16
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": -175,
+      "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
+    },
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "Icon",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 7
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
       {
         "__id__": 9
       },
       {
         "__id__": 10
+      },
+      {
+        "__id__": 11
       }
     ],
     "_prefab": {
-      "__id__": 11
+      "__id__": 12
     },
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": -175,
+      "x": 0,
       "y": 0,
       "z": 0
     },
@@ -294,17 +346,17 @@
   },
   {
     "__type__": "cc.UITransformComponent",
-    "_name": "Background1<UITransformComponent>",
+    "_name": "Icon<UITransformComponent>",
     "_objFlags": 0,
     "node": {
-      "__id__": 7
+      "__id__": 8
     },
     "_enabled": true,
     "_priority": 0,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 190,
-      "height": 124
+      "width": 40,
+      "height": 36
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -315,10 +367,10 @@
   },
   {
     "__type__": "cc.SpriteComponent",
-    "_name": "Background1<SpriteComponent>",
+    "_name": "Icon<SpriteComponent>",
     "_objFlags": 0,
     "node": {
-      "__id__": 7
+      "__id__": 8
     },
     "_enabled": true,
     "_srcBlendFactor": 2,
@@ -332,11 +384,11 @@
     },
     "_sharedMaterial": null,
     "_spriteFrame": {
-      "__uuid__": "10bbf5e9-fbbf-4bfa-b7ab-1d98d4fbc7f1@f9941"
+      "__uuid__": "57520716-48c8-4a19-8acf-41c9f8777fb0@f9941"
     },
-    "_type": 1,
+    "_type": 0,
     "_fillType": 0,
-    "_sizeMode": 0,
+    "_sizeMode": 1,
     "_fillCenter": {
       "__type__": "cc.Vec2",
       "x": 0,
@@ -351,18 +403,18 @@
   },
   {
     "__type__": "cc.WidgetComponent",
-    "_name": "Background1<WidgetComponent>",
+    "_name": "Icon<WidgetComponent>",
     "_objFlags": 0,
     "node": {
-      "__id__": 7
+      "__id__": 8
     },
     "_enabled": true,
-    "_alignFlags": 10,
+    "_alignFlags": 18,
     "_target": null,
-    "_left": 10,
-    "_right": 0,
-    "_top": 69.5,
-    "_bottom": 69.5,
+    "_left": 80,
+    "_right": 355,
+    "_top": 54,
+    "_bottom": 54,
     "_horizontalCenter": 0,
     "_verticalCenter": 0,
     "_isAbsLeft": true,
@@ -371,8 +423,8 @@
     "_isAbsBottom": true,
     "_isAbsHorizontalCenter": true,
     "_isAbsVerticalCenter": true,
-    "_originalWidth": 0,
-    "_originalHeight": 5,
+    "_originalWidth": 40,
+    "_originalHeight": 36,
     "_alignMode": 2,
     "_lockFlags": 0,
     "_id": ""
@@ -385,77 +437,26 @@
     "asset": {
       "__id__": 0
     },
-    "fileId": "04X7AmNsxBFLIUJcC5Y3nb",
+    "fileId": "a0b2N68GZEeaAvuOwSGIRL",
     "sync": false,
     "_synced": {
       "default": false,
       "serializable": false
     }
   },
-  {
-    "__type__": "cc.Node",
-    "_name": "Icon",
-    "_objFlags": 0,
-    "_parent": {
-      "__id__": 1
-    },
-    "_children": [],
-    "_active": true,
-    "_components": [
-      {
-        "__id__": 13
-      },
-      {
-        "__id__": 14
-      },
-      {
-        "__id__": 15
-      }
-    ],
-    "_prefab": {
-      "__id__": 16
-    },
-    "_lpos": {
-      "__type__": "cc.Vec3",
-      "x": -175,
-      "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
-    },
-    "_layer": 33554432,
-    "_euler": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 0,
-      "z": 0
-    },
-    "_id": ""
-  },
   {
     "__type__": "cc.UITransformComponent",
-    "_name": "Icon<UITransformComponent>",
+    "_name": "Background1<UITransformComponent>",
     "_objFlags": 0,
     "node": {
-      "__id__": 12
+      "__id__": 7
     },
     "_enabled": true,
     "_priority": 0,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 40,
-      "height": 36
+      "width": 190,
+      "height": 124
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -466,10 +467,10 @@
   },
   {
     "__type__": "cc.SpriteComponent",
-    "_name": "Icon<SpriteComponent>",
+    "_name": "Background1<SpriteComponent>",
     "_objFlags": 0,
     "node": {
-      "__id__": 12
+      "__id__": 7
     },
     "_enabled": true,
     "_srcBlendFactor": 2,
@@ -483,11 +484,11 @@
     },
     "_sharedMaterial": null,
     "_spriteFrame": {
-      "__uuid__": "57520716-48c8-4a19-8acf-41c9f8777fb0@f9941"
+      "__uuid__": "10bbf5e9-fbbf-4bfa-b7ab-1d98d4fbc7f1@f9941"
     },
-    "_type": 0,
+    "_type": 1,
     "_fillType": 0,
-    "_sizeMode": 1,
+    "_sizeMode": 0,
     "_fillCenter": {
       "__type__": "cc.Vec2",
       "x": 0,
@@ -502,18 +503,18 @@
   },
   {
     "__type__": "cc.WidgetComponent",
-    "_name": "Icon<WidgetComponent>",
+    "_name": "Background1<WidgetComponent>",
     "_objFlags": 0,
     "node": {
-      "__id__": 12
+      "__id__": 7
     },
     "_enabled": true,
-    "_alignFlags": 13,
+    "_alignFlags": 10,
     "_target": null,
-    "_left": 85,
-    "_right": 355,
-    "_top": 54,
-    "_bottom": 54,
+    "_left": 10,
+    "_right": 0,
+    "_top": 69.5,
+    "_bottom": 69.5,
     "_horizontalCenter": 0,
     "_verticalCenter": 0,
     "_isAbsLeft": true,
@@ -522,8 +523,8 @@
     "_isAbsBottom": true,
     "_isAbsHorizontalCenter": true,
     "_isAbsVerticalCenter": true,
-    "_originalWidth": 40,
-    "_originalHeight": 36,
+    "_originalWidth": 0,
+    "_originalHeight": 5,
     "_alignMode": 2,
     "_lockFlags": 0,
     "_id": ""
@@ -536,7 +537,7 @@
     "asset": {
       "__id__": 0
     },
-    "fileId": "a0b2N68GZEeaAvuOwSGIRL",
+    "fileId": "04X7AmNsxBFLIUJcC5Y3nb",
     "sync": false,
     "_synced": {
       "default": false,
@@ -2647,7 +2648,7 @@
     "_priority": 0,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 100,
+      "width": 141,
       "height": 40
     },
     "_anchorPoint": {
@@ -3164,7 +3165,7 @@
     },
     "_enabled": true,
     "icon": {
-      "__id__": 14
+      "__id__": 10
     },
     "levelLabel": {
       "__id__": 36

+ 48 - 0
assets/scripts/engines/buffers/BaseBuffer.ts

@@ -1,4 +1,5 @@
 import { director } from "cc";
+import BufferManager from "./BufferManager";
 import IBuffer from "./IBuffer";
 
 
@@ -20,6 +21,53 @@ export default class BaseBuffer implements IBuffer
         BaseBuffer.uuidIndex++;
     }
 
+    /**
+     * 合并同组BUFFER 如果BUFFER必须是唯一则在Run 函数中调用。
+     */
+    protected mergeBuffer():void{
+        let groupList:IBuffer[]=BufferManager.GetBufferGroup(this.group);
+        let otherTime:number=0;
+        let currentTime:number=director.getCurrentTime();
+        let otherEndTime:number;
+        if(groupList.length>1){
+            groupList.forEach(element => {
+                //排除自身
+                if(element!=this){
+                    otherEndTime=element.GetEndTime();
+                    if(otherEndTime<currentTime){
+                        otherTime+=otherEndTime-currentTime;
+                    }
+                }
+            });
+            //清理
+            while(groupList.length>1){
+                let buffer:IBuffer;
+                for (let index = 0; index < groupList.length; index++) {
+                    buffer = groupList[index];
+                    //排除自身
+                    if(buffer!=this){
+                        BufferManager.RemoveBuffer(buffer);
+                    }
+                }
+                groupList=BufferManager.GetBufferGroup(this.group);
+            }
+        }
+        //合并时间
+        this.time+=otherTime;
+    }
+
+    /**
+     * 剩余时间
+     */
+    GetTimeRemaining(): number {
+        let currentTime:number=director.getCurrentTime();
+        let endTime:number=this.GetEndTime();
+        if(currentTime<endTime){
+            return endTime-currentTime;
+        }
+        return 0;
+    }
+
 
     GetEndTime(): number {
         return this.endTime;

+ 5 - 0
assets/scripts/engines/buffers/IBuffer.ts

@@ -28,4 +28,9 @@ export default interface IBuffer
      * 结束时间点
      */
     GetEndTime():number;
+
+    /**
+     * 剩余时间
+     */
+    GetTimeRemaining():number;
 }

+ 23 - 0
assets/scripts/games/buffers/AccelerateBuffer.ts

@@ -0,0 +1,23 @@
+import BaseBuffer from "../../engines/buffers/BaseBuffer";
+
+
+/**
+ * 加速Buffer
+ */
+export default class AccelerateBuffer extends BaseBuffer
+{
+    /**
+     * 倍率
+     */
+    rate:number=2.0;
+
+    constructor(group:string,time:number,rate:number=2.0){
+        super(group,time);
+        this.rate=1/rate;
+    }
+    
+    Run(data?:any):void{
+        this.mergeBuffer();
+        super.Run(data);
+    }
+}

+ 15 - 0
assets/scripts/games/buffers/AccelerateBuffer.ts.meta

@@ -0,0 +1,15 @@
+{
+  "ver": "2.0.14",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "d4a8681e-ebfd-4f04-b7df-de2abd4e5f62",
+  "files": [
+    ".js",
+    ".trans"
+  ],
+  "subMetas": {},
+  "userData": {
+    "importAsPlugin": false,
+    "moduleId": "project:///assets/scripts/games/buffers/AccelerateBuffer.js"
+  }
+}

+ 0 - 32
assets/scripts/games/buffers/AutoSyntheticBuffer.ts

@@ -19,38 +19,6 @@ export default class AutoSyntheticBuffer extends BaseBuffer
         super.Run(data);
     }
 
-    private mergeBuffer():void{
-        let groupList:IBuffer[]=BufferManager.GetBufferGroup(this.group);
-        let otherTime:number=0;
-        let currentTime:number=director.getCurrentTime();
-        let otherEndTime:number;
-        if(groupList.length>1){
-            groupList.forEach(element => {
-                //排除自身
-                if(element!=this){
-                    otherEndTime=element.GetEndTime();
-                    if(otherEndTime<currentTime){
-                        otherTime+=otherEndTime-currentTime;
-                    }
-                }
-            });
-            //清理
-            while(groupList.length>1){
-                let buffer:IBuffer;
-                for (let index = 0; index < groupList.length; index++) {
-                    buffer = groupList[index];
-                    //排除自身
-                    if(buffer!=this){
-                        BufferManager.RemoveBuffer(buffer);
-                    }
-                }
-                groupList=BufferManager.GetBufferGroup(this.group);
-            }
-        }
-        //合并时间
-        this.time+=otherTime;
-    }
-
     lastTime:number=0;
     /**
      * 心跳

+ 44 - 14
assets/scripts/games/models/GameModel.ts

@@ -5,6 +5,7 @@ import { EventDispatcher } from '../../engines/events/EventDispatcher';
 import { DataModel } from '../../engines/models/DataModel';
 import { DataModelEventType } from '../../engines/models/DataModelEventType';
 import { NoticeManager } from '../../engines/notices/NoticeManager';
+import AccelerateBuffer from '../buffers/AccelerateBuffer';
 import AutoSyntheticBuffer from '../buffers/AutoSyntheticBuffer';
 import GameConfigManager from './GameConfigManager';
 import { GamePropertys } from './GamePropertys';
@@ -73,19 +74,14 @@ export class GameModel extends DataModel{
      */
     public fullEarnings:number=0;
 
-    /**
-     * 收益计算间隔
-     */
-    get earningsInterval():number{
-        return GameConfigManager.getGlobalValue("earningsInterval");
-    }
+
 
     /**
      * 计算收益
      */
     CheckEarnings():void{
         let currentTime:number=director.getCurrentTime();
-        if(currentTime-this.lastTime<1000){
+        if(currentTime-this.lastTime<this.earningTime){
             return;
         }
         this.lastTime=currentTime;
@@ -110,6 +106,25 @@ export class GameModel extends DataModel{
         }
     }
 
+    /**
+     * 收益计算间隔
+     */
+    get earningsInterval():number{
+        return GameConfigManager.getGlobalValue("earningsInterval");
+    }
+
+    /**
+     * 收益间隔时间
+     */
+    get earningTime():number{
+        let bufferList:IBuffer[]=BufferManager.GetBufferGroup("Accelerate");
+        if(bufferList==null||bufferList.length==0){
+            return this.earningsInterval;
+        }
+        let buffer:AccelerateBuffer=bufferList[0] as AccelerateBuffer;
+        return this.earningsInterval*buffer.rate;
+    }
+
     /**
      * 自动合成武器
      */
@@ -132,7 +147,7 @@ export class GameModel extends DataModel{
                     this.SynthesisWeapon(a.cellId,b.cellId);
                     synIndex++;
                     //如果大于最大数
-                    if(synIndex>max){
+                    if(synIndex>=max){
                         return;
                     }
                 }
@@ -435,6 +450,11 @@ export class GameModel extends DataModel{
             let buffer:AutoSyntheticBuffer=new AutoSyntheticBuffer("AutoSynthesis",data.autoSynthesisTime);
             BufferManager.RunBuffer(buffer);
         }
+        //加速Buffer
+        if(data.accelerateTime>0){
+            let buffer:AccelerateBuffer=new AccelerateBuffer("Accelerate",data.accelerateTime);
+            BufferManager.RunBuffer(buffer);
+        }
     }
 
     protected OnSaveToLocal(data:any):void{
@@ -444,15 +464,18 @@ export class GameModel extends DataModel{
         let buffers:IBuffer[]=BufferManager.GetBufferGroup("AutoSynthesis");
         if(buffers!=null&&buffers.length>0){
             let buffer:IBuffer=buffers[0];
-            let currentTime:number=director.getCurrentTime();
-            let endTime:number=buffer.GetEndTime();
-            if(currentTime<endTime){
-                let time:number=endTime-currentTime;
-                data.autoSynthesisTime=time;
-            }
+            data.autoSynthesisTime=buffer.GetTimeRemaining();
         }else{
             data.autoSynthesisTime=0;
         }
+        //加速Buffer
+        buffers=BufferManager.GetBufferGroup("Accelerate");
+        if(buffers!=null&&buffers.length>0){
+            let accelerateBuffer:AccelerateBuffer=buffers[0] as AccelerateBuffer;
+            data.accelerateTime=accelerateBuffer.GetTimeRemaining();
+        }else{
+            data.accelerateTime=0;
+        }
     }
     
     private static instance:GameModel;
@@ -470,6 +493,13 @@ export class GameModel extends DataModel{
         return this.GetProperty(GamePropertys.autoSynthesisTime);
     }
 
+    /**
+     * 加速Buffer剩余时间
+     */
+    get accelerateTime():number{
+        return this.GetProperty(GamePropertys.accelerateTime);
+    }
+
     /**
      * 当前关卡
      */

+ 4 - 0
assets/scripts/games/models/GamePropertys.ts

@@ -67,4 +67,8 @@ export class GamePropertys {
      * 自动合成Buffer剩余时间
      */
     public static autoSynthesisTime:string="autoSynthesisTime";
+    /**
+     * 加速BUFFER剩余时间
+     */
+    public static accelerateTime:string="accelerateTime";
 }

+ 12 - 0
assets/scripts/games/ui/UIConst.ts

@@ -28,6 +28,16 @@ export class UIConst extends Component {
      * 商城界面
      */
     public static FULL_OUTPUT_UI:number=4;
+
+    /**
+     * 自动合成
+     */
+    public static AUTO_SYNTHETIC_UI:number=5;
+
+    /**
+     * 加速
+     */
+    public static ACCELERATE_UI:number=6;
     
     //注册所有游戏UI
     static RegisterGUI():void{
@@ -36,5 +46,7 @@ export class UIConst extends Component {
         GUIManager.single.RegisterGUI(this.GAME_OVER_UI,"ui/GameOverUI");
         GUIManager.single.RegisterGUI(this.SHOP_UI,"ui/ShopUI");
         GUIManager.single.RegisterGUI(this.FULL_OUTPUT_UI,"ui/FullScreenui");
+        GUIManager.single.RegisterGUI(this.AUTO_SYNTHETIC_UI,"ui/AutoSyntheticUI");
+        GUIManager.single.RegisterGUI(this.ACCELERATE_UI,"ui/SpeedUpUI");
     }
 }

+ 9 - 0
assets/scripts/games/ui/autoSynthesis.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "0.0.1",
+  "importer": "*",
+  "imported": true,
+  "uuid": "7836f921-5ca5-47e3-af37-1ea598658898",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 76 - 0
assets/scripts/games/ui/autoSynthesis/AutoSynthesisMediator.ts

@@ -0,0 +1,76 @@
+import { _decorator, Component, Node, LabelComponent } from 'cc';
+import BufferManager from '../../../engines/buffers/BufferManager';
+import IBuffer from '../../../engines/buffers/IBuffer';
+import { GUIMediator } from '../../../engines/gui/GUIMediator';
+import { DataModelEventType } from '../../../engines/models/DataModelEventType';
+import { NoticeManager } from '../../../engines/notices/NoticeManager';
+import { PlatformManager } from '../../../Platform/PlatformManager';
+import AutoSyntheticBuffer from '../../buffers/AutoSyntheticBuffer';
+import { GameModel } from '../../models/GameModel';
+import { GamePropertys } from '../../models/GamePropertys';
+const { ccclass, property } = _decorator;
+
+@ccclass('AutoSynthesisMediator')
+export class AutoSynthesisMediator extends GUIMediator {
+
+    @property({
+        type:LabelComponent
+    })
+    diamondLabel:LabelComponent=null;
+
+    OnShow(data?:any):void{
+        super.OnShow(data);
+        this.RefreshView();
+    }
+
+    OnHide():void{
+
+    }
+
+    private RefreshView():void{
+        this.diamondLabel.string="20";
+    }
+
+    /**
+     * 钻石按钮点击
+     */
+    DiamondButtonClickHandler():void{
+        if(GameModel.single.diamond>20){
+            if(this.AddBuffer()){
+                //扣钱
+                GameModel.single.diamond-=20;
+            }
+        }else{
+            NoticeManager.ShowPrompt("钻石不足");
+        }
+    }
+
+    /**
+     * 视频按钮点击
+     */
+    VideoButtonClickHandler():void{
+        PlatformManager.showRewardedVideo(()=>{
+            this.AddBuffer();
+        },()=>{
+            NoticeManager.ShowPrompt("看视频失败");
+        });
+    }
+
+    /**
+     * 关闭按钮点击
+     */
+    CloseButtonClickHandler():void{
+        this.HideSelf();
+    }
+
+    private AddBuffer():boolean{
+        let buffers:IBuffer[]=BufferManager.GetBufferGroup("AutoSynthesis");
+        if(buffers!=null&&buffers.length>0){
+            NoticeManager.ShowPrompt("自动合成已开启");
+            return false;
+        }
+        let buffer:AutoSyntheticBuffer=new AutoSyntheticBuffer("AutoSynthesis",5*60*1000);
+        BufferManager.RunBuffer(buffer);
+        return true;
+    }
+}

+ 15 - 0
assets/scripts/games/ui/autoSynthesis/AutoSynthesisMediator.ts.meta

@@ -0,0 +1,15 @@
+{
+  "ver": "2.0.14",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "8af313a4-ec46-4efb-b3c6-f108e8f677e9",
+  "files": [
+    ".js",
+    ".trans"
+  ],
+  "subMetas": {},
+  "userData": {
+    "importAsPlugin": false,
+    "moduleId": "project:///assets/scripts/games/ui/autoSynthesis/AutoSynthesisMediator.js"
+  }
+}

+ 23 - 13
assets/scripts/games/ui/prepares/PrepareMediator.ts

@@ -10,6 +10,7 @@ import { SoundManager } from '../../../engines/sounds/SoundManager';
 import StringUtils from '../../../engines/utils/StringUtils';
 import { PlatformManager } from '../../../Platform/PlatformManager';
 import { WeChatPlatform } from '../../../Platform/WeChat/WeChatPlatform';
+import AccelerateBuffer from '../../buffers/AccelerateBuffer';
 import AutoSyntheticBuffer from '../../buffers/AutoSyntheticBuffer';
 import GameConfigManager from '../../models/GameConfigManager';
 import { GameModel } from '../../models/GameModel';
@@ -20,6 +21,10 @@ const { ccclass, property } = _decorator;
 
 @ccclass('PrepareMediator')
 export class PrepareMediator extends GUIMediator {
+    @property({
+        type: Node
+    })
+    bufferNode: Node = null;
 
     @property({
         type: LabelComponent
@@ -329,12 +334,14 @@ export class PrepareMediator extends GUIMediator {
      * 自动合成按钮点击
      */
     AutoSynthesisButtonClickHandler():void{
-        let buffers:IBuffer[]=BufferManager.GetBufferGroup("AutoSynthesis");
-        if(buffers!=null&&buffers.length>0){
-            NoticeManager.ShowPrompt("自动合成已开启");
-            return;
-        }
-        let buffer:AutoSyntheticBuffer=new AutoSyntheticBuffer("AutoSynthesis",5*60*1000);
+        GUIManager.single.Show(UIConst.AUTO_SYNTHETIC_UI);
+    }
+
+    /**
+     * 加速Buffer;
+     */
+    AccelerateButtonClickHandler():void{
+        let buffer:AccelerateBuffer=new AccelerateBuffer("Accelerate",150*1000);
         BufferManager.RunBuffer(buffer);
     }
 
@@ -388,7 +395,7 @@ export class PrepareMediator extends GUIMediator {
     getAdGold(): void {
         PlatformManager.showRewardedVideo(()=>{
             GameModel.single.gold += GameModel.single.fullEarnings * 600;
-            NoticeManager.ShowPrompt(`获得${GameModel.single.fullEarnings * 600}金币`);
+            NoticeManager.ShowPrompt(`获得${StringUtils.numberUtilsEn(GameModel.single.fullEarnings * 600)}金币`);
         },()=>{
             NoticeManager.ShowPrompt(`未看完广告,无奖励`);
         })
@@ -404,14 +411,17 @@ export class PrepareMediator extends GUIMediator {
         let buffers:IBuffer[]=BufferManager.GetBufferGroup("AutoSynthesis");
         if(buffers!=null&&buffers.length>0){
             let buffer:IBuffer=buffers[0];
-            let currentTime:number=director.getCurrentTime();
-            let endTime:number=buffer.GetEndTime();
-            if(currentTime<endTime){
-                let time:number=endTime-currentTime;
-                this.autoSynthesisLabel.string=StringUtils.TimeFormatting(time,":",":",":","");
-            }
+            let endTime:number=buffer.GetTimeRemaining();
+            this.autoSynthesisLabel.string=StringUtils.TimeFormatting(endTime,":",":",":","");
         }else{
             this.autoSynthesisLabel.string="自动合成";
         }
+        //加速Buffer
+        buffers=BufferManager.GetBufferGroup("Accelerate");
+        if(buffers!=null&&buffers.length>0){
+            this.bufferNode.active=true;
+        }else{
+            this.bufferNode.active=false;
+        }
     }
 }

+ 4 - 3
assets/scripts/games/ui/prepares/WeaponCellScript.ts

@@ -1,6 +1,7 @@
 import { Component, director, find, LabelComponent, loader, Node, SpriteComponent, SpriteFrame, systemEvent, SystemEventType, Touch, Vec2, Vec3, _decorator } from 'cc';
 import { NoticeManager } from '../../../engines/notices/NoticeManager';
 import NodeUtils from '../../../engines/utils/NodeUtils';
+import StringUtils from '../../../engines/utils/StringUtils';
 import GameConfigManager from '../../models/GameConfigManager';
 import { GameModel } from '../../models/GameModel';
 import { WeaponCell } from '../../models/weapons/WeaponCell';
@@ -105,7 +106,7 @@ export class WeaponCellScript extends Component {
             this.weaponConfig=GameConfigManager.GetWeaponConfig(this.weaponCell.weaponId);
             //收益
             this.earningsLabel.node.active=true;
-            this.earningsLabel.string=Math.floor(this.weaponConfig.earnings).toString();
+            this.earningsLabel.string=StringUtils.numberUtilsEn(this.weaponConfig.earnings*GameModel.single.earningTime/1000);
             //等级
             this.labelGroup.active=true;
             if(GameConfigManager.WeaponIsMaxLevel(this.weaponCell.weaponId)){
@@ -169,13 +170,13 @@ export class WeaponCellScript extends Component {
             return;
         }
         let currentTime:number=director.getCurrentTime();
-        let IntervalTime:number=GameModel.single.earningsInterval;
+        let IntervalTime:number=GameModel.single.earningTime;
         let IntervalTimeS:number=IntervalTime/1000;
         if(currentTime-this.weaponCell.lastOutputTime>IntervalTime){
             let startPos:Vec3=new Vec3();
             NodeUtils.GetNodePos(this.node,startPos);
             startPos.x+=this.node.width/2;
-            NoticeManager.ShowPromptByPos("金币:+"+(this.weaponCell.weaponConfig.earnings* IntervalTimeS),startPos);
+            NoticeManager.ShowPromptByPos("金币:+"+StringUtils.numberUtilsEn(this.weaponCell.weaponConfig.earnings* IntervalTimeS),startPos);
             this.weaponCell.lastOutputTime=currentTime;
         }
     }

+ 3 - 2
assets/scripts/games/ui/shops/ShopItemRenderScript.ts

@@ -1,5 +1,6 @@
 import { _decorator, Component, Node, profiler, SpriteComponent, LabelComponent, ButtonComponent, loader, SpriteFrame } from 'cc';
 import { NoticeManager } from '../../../engines/notices/NoticeManager';
+import StringUtils from '../../../engines/utils/StringUtils';
 import { PlatformManager } from '../../../Platform/PlatformManager';
 import GameConfigManager from '../../models/GameConfigManager';
 import { GameModel } from '../../models/GameModel';
@@ -89,12 +90,12 @@ export class ShopItemRenderScript extends Component {
                 this.freeBuyButton.node.active=this.diamondBuyButton.node.active=false;
                 this.GlodBuyButton.node.active=true;
                 price=GameModel.single.GetWeaponBuyPrice(this.data.id);
-                this.freeBuyButtonLabel.string=price.toString();
+                this.freeBuyButtonLabel.string=StringUtils.numberUtilsEn(price);
             }else if(this.data.buyType==1){//宝石购买
                 this.freeBuyButton.node.active=this.GlodBuyButton.node.active=false;
                 this.diamondBuyButton.node.active=true;
                 price=weaponConfig.consumeDiamond;
-                this.diamondBuyButtonLabel.string=price.toString();
+                this.diamondBuyButtonLabel.string=StringUtils.numberUtilsEn(price);
             }else{//广告购买
                 this.diamondBuyButton.node.active=this.GlodBuyButton.node.active=false;
                 this.freeBuyButton.node.active=true;