浏览代码

Merge branch 'master' of http://118.178.135.110:3000/fish/tower_client

# Conflicts:
#	assets/script/game/common/LoginManager.ts
#	assets/script/game/data/RoleData.ts
wujia 6 月之前
父节点
当前提交
ece8da6b1a
共有 30 个文件被更改,包括 4980 次插入947 次删除
  1. 790 0
      assets/package/prefab/ui/tower/hero/role101.prefab
  2. 13 0
      assets/package/prefab/ui/tower/hero/role101.prefab.meta
  3. 790 0
      assets/package/prefab/ui/tower/hero/role201.prefab
  4. 13 0
      assets/package/prefab/ui/tower/hero/role201.prefab.meta
  5. 790 0
      assets/package/prefab/ui/tower/hero/role301.prefab
  6. 13 0
      assets/package/prefab/ui/tower/hero/role301.prefab.meta
  7. 790 0
      assets/package/prefab/ui/tower/hero/role401.prefab
  8. 13 0
      assets/package/prefab/ui/tower/hero/role401.prefab.meta
  9. 442 209
      assets/package/prefab/ui/tower/tower.prefab
  10. 13 5
      assets/script/game/common/LoginManager.ts
  11. 149 0
      assets/script/game/data/BattleData.ts
  12. 1 1
      assets/script/game/data/BattleData.ts.meta
  13. 2 2
      assets/script/game/data/RoleData.ts
  14. 37 11
      assets/script/game/data/UserData.ts
  15. 126 0
      assets/script/game/manager/BattleManager.ts
  16. 9 0
      assets/script/game/manager/BattleManager.ts.meta
  17. 1 0
      assets/script/game/ui/hero/EquipOpreate.ts
  18. 1 1
      assets/script/game/ui/login/LoginUI.ts
  19. 438 110
      assets/script/game/ui/tower/TowerUI.ts
  20. 12 12
      assets/script/game/ui/tower/ZombieUI.ts
  21. 1 0
      assets/script/game/ui/tower/base/BattleEventUtil.ts
  22. 499 479
      assets/script/game/ui/tower/conf/BattlesConf.ts
  23. 0 58
      assets/script/game/ui/tower/conf/HeroConf.ts
  24. 2 2
      assets/script/game/ui/tower/conf/MapConf.ts
  25. 2 43
      assets/script/game/ui/tower/control/BattleControl.ts
  26. 1 1
      assets/script/game/ui/tower/control/BuffControl.ts
  27. 1 0
      assets/script/game/ui/tower/control/EnemyControl.ts
  28. 2 1
      assets/script/game/ui/tower/data/BattleUtil.ts
  29. 13 3
      assets/script/game/ui/tower/data/HeroData.ts
  30. 16 9
      assets/script/game/ui/tower/node/Hero.ts

+ 790 - 0
assets/package/prefab/ui/tower/hero/role101.prefab

@@ -0,0 +1,790 @@
+[
+  {
+    "__type__": "cc.Prefab",
+    "_name": "role101",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_native": "",
+    "data": {
+      "__id__": 1
+    },
+    "optimizationPolicy": 0,
+    "persistent": false
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "role101",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": null,
+    "_children": [
+      {
+        "__id__": 2
+      },
+      {
+        "__id__": 9
+      },
+      {
+        "__id__": 15
+      },
+      {
+        "__id__": 19
+      },
+      {
+        "__id__": 23
+      }
+    ],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 29
+      },
+      {
+        "__id__": 31
+      }
+    ],
+    "_prefab": {
+      "__id__": 33
+    },
+    "_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": "npc",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 3
+      },
+      {
+        "__id__": 5
+      }
+    ],
+    "_prefab": {
+      "__id__": 8
+    },
+    "_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": 0.5,
+      "y": 0.5,
+      "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": 191.5,
+      "height": 238
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "62c7sTO15NIYHtbCZKBnm3"
+  },
+  {
+    "__type__": "sp.Skeleton",
+    "_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
+    },
+    "_skeletonData": {
+      "__uuid__": "6d70d1a2-07f3-4cf8-a149-a1fbfd7f02a4",
+      "__expectedType__": "sp.SkeletonData"
+    },
+    "defaultSkin": "default",
+    "defaultAnimation": "stand_right",
+    "_premultipliedAlpha": false,
+    "_timeScale": 1,
+    "_preCacheMode": 0,
+    "_cacheMode": 0,
+    "_sockets": [
+      {
+        "__id__": 7
+      }
+    ],
+    "_useTint": false,
+    "_debugMesh": false,
+    "_debugBones": false,
+    "_debugSlots": false,
+    "_enableBatch": false,
+    "loop": true,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "5f0h48yVBGZY0ahBHmjV3e"
+  },
+  {
+    "__type__": "sp.Skeleton.SpineSocket",
+    "path": "",
+    "target": null
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "18ZiTvpwpIWqAdAYs5FNI4",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "fightforce",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 10
+      },
+      {
+        "__id__": 12
+      }
+    ],
+    "_prefab": {
+      "__id__": 14
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 30,
+      "y": -30,
+      "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__": 9
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 11
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 18.69,
+      "height": 40
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "ffAQh9LAtB9pD2eiM3q0pP"
+  },
+  {
+    "__type__": "cc.Label",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 9
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 13
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_string": "1",
+    "_horizontalAlign": 1,
+    "_verticalAlign": 1,
+    "_actualFontSize": 26,
+    "_fontSize": 26,
+    "_fontFamily": "Arial",
+    "_lineHeight": 40,
+    "_overflow": 0,
+    "_enableWrapText": true,
+    "_font": {
+      "__uuid__": "65941af8-fc7e-447d-a557-0406909c778c",
+      "__expectedType__": "cc.BitmapFont"
+    },
+    "_isSystemFontUsed": false,
+    "_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": "24qHA3h5lNbrUG7T6ZIVfp"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "5diXWPbKRNhqJJ5UB/wt+P",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "Node",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 16
+      }
+    ],
+    "_prefab": {
+      "__id__": 18
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 47.125999999999976,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1.0000000000000038,
+      "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__": 15
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 17
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 100,
+      "height": 100
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "96cFqmKP1I1r2qUAsGp1K0"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "d54T+Jwk5IUIUtK6EFRTsO",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "click_box",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 20
+      }
+    ],
+    "_prefab": {
+      "__id__": 22
+    },
+    "_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__": 19
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 21
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 100,
+      "height": 100
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "fa8bVTxolHQZKhrAY1x1BA"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "50Hixedt5JfLFR+Jfv0bEl",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "Label",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 24
+      },
+      {
+        "__id__": 26
+      }
+    ],
+    "_prefab": {
+      "__id__": 28
+    },
+    "_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__": 23
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 25
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 102.3046875,
+      "height": 50.4
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "91+aLmR25O/5tRRkpm4Yaa"
+  },
+  {
+    "__type__": "cc.Label",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 23
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 27
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_string": "hero1",
+    "_horizontalAlign": 1,
+    "_verticalAlign": 1,
+    "_actualFontSize": 40,
+    "_fontSize": 40,
+    "_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": "342cWLb9xGtLO6i6EU7a6Q"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "1021Gqie9BUZQrOfh7iKFr",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 30
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 90,
+      "height": 90
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "c2aFUu6jBJg5uJ60FKMad/"
+  },
+  {
+    "__type__": "93e322oxm1M+7IXMqWiSdAA",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 32
+    },
+    "modelSpine": {
+      "__id__": 5
+    },
+    "levelLabel": {
+      "__id__": 12
+    },
+    "gunNode": {
+      "__id__": 15
+    },
+    "clickBox": {
+      "__id__": 20
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "5cADCscdNBYbIaIWYE2qFR"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "4cbne1jbpGk4QF3TRtbCOc",
+    "instance": null,
+    "targetOverrides": null
+  }
+]

+ 13 - 0
assets/package/prefab/ui/tower/hero/role101.prefab.meta

@@ -0,0 +1,13 @@
+{
+  "ver": "1.1.50",
+  "importer": "prefab",
+  "imported": true,
+  "uuid": "84578799-ad0b-4723-b0c1-d3bcbe8208fe",
+  "files": [
+    ".json"
+  ],
+  "subMetas": {},
+  "userData": {
+    "syncNodeName": "role101"
+  }
+}

+ 790 - 0
assets/package/prefab/ui/tower/hero/role201.prefab

@@ -0,0 +1,790 @@
+[
+  {
+    "__type__": "cc.Prefab",
+    "_name": "role201",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_native": "",
+    "data": {
+      "__id__": 1
+    },
+    "optimizationPolicy": 0,
+    "persistent": false
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "role201",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": null,
+    "_children": [
+      {
+        "__id__": 2
+      },
+      {
+        "__id__": 9
+      },
+      {
+        "__id__": 15
+      },
+      {
+        "__id__": 19
+      },
+      {
+        "__id__": 23
+      }
+    ],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 29
+      },
+      {
+        "__id__": 31
+      }
+    ],
+    "_prefab": {
+      "__id__": 33
+    },
+    "_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": "npc",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 3
+      },
+      {
+        "__id__": 5
+      }
+    ],
+    "_prefab": {
+      "__id__": 8
+    },
+    "_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": 0.5,
+      "y": 0.5,
+      "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": 191.5,
+      "height": 238
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "62c7sTO15NIYHtbCZKBnm3"
+  },
+  {
+    "__type__": "sp.Skeleton",
+    "_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
+    },
+    "_skeletonData": {
+      "__uuid__": "6d70d1a2-07f3-4cf8-a149-a1fbfd7f02a4",
+      "__expectedType__": "sp.SkeletonData"
+    },
+    "defaultSkin": "default",
+    "defaultAnimation": "stand_right",
+    "_premultipliedAlpha": false,
+    "_timeScale": 1,
+    "_preCacheMode": 0,
+    "_cacheMode": 0,
+    "_sockets": [
+      {
+        "__id__": 7
+      }
+    ],
+    "_useTint": false,
+    "_debugMesh": false,
+    "_debugBones": false,
+    "_debugSlots": false,
+    "_enableBatch": false,
+    "loop": true,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "5f0h48yVBGZY0ahBHmjV3e"
+  },
+  {
+    "__type__": "sp.Skeleton.SpineSocket",
+    "path": "",
+    "target": null
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "18ZiTvpwpIWqAdAYs5FNI4",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "fightforce",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 10
+      },
+      {
+        "__id__": 12
+      }
+    ],
+    "_prefab": {
+      "__id__": 14
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 30,
+      "y": -30,
+      "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__": 9
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 11
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 18.69,
+      "height": 40
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "ffAQh9LAtB9pD2eiM3q0pP"
+  },
+  {
+    "__type__": "cc.Label",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 9
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 13
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_string": "1",
+    "_horizontalAlign": 1,
+    "_verticalAlign": 1,
+    "_actualFontSize": 26,
+    "_fontSize": 26,
+    "_fontFamily": "Arial",
+    "_lineHeight": 40,
+    "_overflow": 0,
+    "_enableWrapText": true,
+    "_font": {
+      "__uuid__": "65941af8-fc7e-447d-a557-0406909c778c",
+      "__expectedType__": "cc.BitmapFont"
+    },
+    "_isSystemFontUsed": false,
+    "_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": "24qHA3h5lNbrUG7T6ZIVfp"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "5diXWPbKRNhqJJ5UB/wt+P",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "Node",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 16
+      }
+    ],
+    "_prefab": {
+      "__id__": 18
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 47.125999999999976,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1.0000000000000038,
+      "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__": 15
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 17
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 100,
+      "height": 100
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "96cFqmKP1I1r2qUAsGp1K0"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "d54T+Jwk5IUIUtK6EFRTsO",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "click_box",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 20
+      }
+    ],
+    "_prefab": {
+      "__id__": 22
+    },
+    "_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__": 19
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 21
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 100,
+      "height": 100
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "fa8bVTxolHQZKhrAY1x1BA"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "50Hixedt5JfLFR+Jfv0bEl",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "Label",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 24
+      },
+      {
+        "__id__": 26
+      }
+    ],
+    "_prefab": {
+      "__id__": 28
+    },
+    "_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__": 23
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 25
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 102.3046875,
+      "height": 50.4
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "91+aLmR25O/5tRRkpm4Yaa"
+  },
+  {
+    "__type__": "cc.Label",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 23
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 27
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_string": "hero2",
+    "_horizontalAlign": 1,
+    "_verticalAlign": 1,
+    "_actualFontSize": 40,
+    "_fontSize": 40,
+    "_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": "342cWLb9xGtLO6i6EU7a6Q"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "1021Gqie9BUZQrOfh7iKFr",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 30
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 90,
+      "height": 90
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "c2aFUu6jBJg5uJ60FKMad/"
+  },
+  {
+    "__type__": "93e322oxm1M+7IXMqWiSdAA",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 32
+    },
+    "modelSpine": {
+      "__id__": 5
+    },
+    "levelLabel": {
+      "__id__": 12
+    },
+    "gunNode": {
+      "__id__": 15
+    },
+    "clickBox": {
+      "__id__": 20
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "5cADCscdNBYbIaIWYE2qFR"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "4cbne1jbpGk4QF3TRtbCOc",
+    "instance": null,
+    "targetOverrides": null
+  }
+]

+ 13 - 0
assets/package/prefab/ui/tower/hero/role201.prefab.meta

@@ -0,0 +1,13 @@
+{
+  "ver": "1.1.50",
+  "importer": "prefab",
+  "imported": true,
+  "uuid": "6c34e723-9d0b-4f67-98b2-0148088e613b",
+  "files": [
+    ".json"
+  ],
+  "subMetas": {},
+  "userData": {
+    "syncNodeName": "role201"
+  }
+}

+ 790 - 0
assets/package/prefab/ui/tower/hero/role301.prefab

@@ -0,0 +1,790 @@
+[
+  {
+    "__type__": "cc.Prefab",
+    "_name": "role301",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_native": "",
+    "data": {
+      "__id__": 1
+    },
+    "optimizationPolicy": 0,
+    "persistent": false
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "role301",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": null,
+    "_children": [
+      {
+        "__id__": 2
+      },
+      {
+        "__id__": 9
+      },
+      {
+        "__id__": 15
+      },
+      {
+        "__id__": 19
+      },
+      {
+        "__id__": 23
+      }
+    ],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 29
+      },
+      {
+        "__id__": 31
+      }
+    ],
+    "_prefab": {
+      "__id__": 33
+    },
+    "_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": "npc",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 3
+      },
+      {
+        "__id__": 5
+      }
+    ],
+    "_prefab": {
+      "__id__": 8
+    },
+    "_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": 0.5,
+      "y": 0.5,
+      "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": 191.5,
+      "height": 238
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "62c7sTO15NIYHtbCZKBnm3"
+  },
+  {
+    "__type__": "sp.Skeleton",
+    "_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
+    },
+    "_skeletonData": {
+      "__uuid__": "6d70d1a2-07f3-4cf8-a149-a1fbfd7f02a4",
+      "__expectedType__": "sp.SkeletonData"
+    },
+    "defaultSkin": "default",
+    "defaultAnimation": "stand_right",
+    "_premultipliedAlpha": false,
+    "_timeScale": 1,
+    "_preCacheMode": 0,
+    "_cacheMode": 0,
+    "_sockets": [
+      {
+        "__id__": 7
+      }
+    ],
+    "_useTint": false,
+    "_debugMesh": false,
+    "_debugBones": false,
+    "_debugSlots": false,
+    "_enableBatch": false,
+    "loop": true,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "5f0h48yVBGZY0ahBHmjV3e"
+  },
+  {
+    "__type__": "sp.Skeleton.SpineSocket",
+    "path": "",
+    "target": null
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "18ZiTvpwpIWqAdAYs5FNI4",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "fightforce",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 10
+      },
+      {
+        "__id__": 12
+      }
+    ],
+    "_prefab": {
+      "__id__": 14
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 30,
+      "y": -30,
+      "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__": 9
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 11
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 18.69,
+      "height": 40
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "ffAQh9LAtB9pD2eiM3q0pP"
+  },
+  {
+    "__type__": "cc.Label",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 9
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 13
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_string": "1",
+    "_horizontalAlign": 1,
+    "_verticalAlign": 1,
+    "_actualFontSize": 26,
+    "_fontSize": 26,
+    "_fontFamily": "Arial",
+    "_lineHeight": 40,
+    "_overflow": 0,
+    "_enableWrapText": true,
+    "_font": {
+      "__uuid__": "65941af8-fc7e-447d-a557-0406909c778c",
+      "__expectedType__": "cc.BitmapFont"
+    },
+    "_isSystemFontUsed": false,
+    "_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": "24qHA3h5lNbrUG7T6ZIVfp"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "5diXWPbKRNhqJJ5UB/wt+P",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "Node",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 16
+      }
+    ],
+    "_prefab": {
+      "__id__": 18
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 47.125999999999976,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1.0000000000000038,
+      "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__": 15
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 17
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 100,
+      "height": 100
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "96cFqmKP1I1r2qUAsGp1K0"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "d54T+Jwk5IUIUtK6EFRTsO",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "click_box",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 20
+      }
+    ],
+    "_prefab": {
+      "__id__": 22
+    },
+    "_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__": 19
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 21
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 100,
+      "height": 100
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "fa8bVTxolHQZKhrAY1x1BA"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "50Hixedt5JfLFR+Jfv0bEl",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "Label",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 24
+      },
+      {
+        "__id__": 26
+      }
+    ],
+    "_prefab": {
+      "__id__": 28
+    },
+    "_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__": 23
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 25
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 102.3046875,
+      "height": 50.4
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "91+aLmR25O/5tRRkpm4Yaa"
+  },
+  {
+    "__type__": "cc.Label",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 23
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 27
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_string": "hero3",
+    "_horizontalAlign": 1,
+    "_verticalAlign": 1,
+    "_actualFontSize": 40,
+    "_fontSize": 40,
+    "_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": "342cWLb9xGtLO6i6EU7a6Q"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "1021Gqie9BUZQrOfh7iKFr",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 30
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 90,
+      "height": 90
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "c2aFUu6jBJg5uJ60FKMad/"
+  },
+  {
+    "__type__": "93e322oxm1M+7IXMqWiSdAA",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 32
+    },
+    "modelSpine": {
+      "__id__": 5
+    },
+    "levelLabel": {
+      "__id__": 12
+    },
+    "gunNode": {
+      "__id__": 15
+    },
+    "clickBox": {
+      "__id__": 20
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "5cADCscdNBYbIaIWYE2qFR"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "4cbne1jbpGk4QF3TRtbCOc",
+    "instance": null,
+    "targetOverrides": null
+  }
+]

+ 13 - 0
assets/package/prefab/ui/tower/hero/role301.prefab.meta

@@ -0,0 +1,13 @@
+{
+  "ver": "1.1.50",
+  "importer": "prefab",
+  "imported": true,
+  "uuid": "616e0cea-be2b-4259-bdb2-d77747965d3c",
+  "files": [
+    ".json"
+  ],
+  "subMetas": {},
+  "userData": {
+    "syncNodeName": "role301"
+  }
+}

+ 790 - 0
assets/package/prefab/ui/tower/hero/role401.prefab

@@ -0,0 +1,790 @@
+[
+  {
+    "__type__": "cc.Prefab",
+    "_name": "role401",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_native": "",
+    "data": {
+      "__id__": 1
+    },
+    "optimizationPolicy": 0,
+    "persistent": false
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "role401",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": null,
+    "_children": [
+      {
+        "__id__": 2
+      },
+      {
+        "__id__": 9
+      },
+      {
+        "__id__": 15
+      },
+      {
+        "__id__": 19
+      },
+      {
+        "__id__": 23
+      }
+    ],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 29
+      },
+      {
+        "__id__": 31
+      }
+    ],
+    "_prefab": {
+      "__id__": 33
+    },
+    "_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": "npc",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 3
+      },
+      {
+        "__id__": 5
+      }
+    ],
+    "_prefab": {
+      "__id__": 8
+    },
+    "_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": 0.5,
+      "y": 0.5,
+      "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": 191.5,
+      "height": 238
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "62c7sTO15NIYHtbCZKBnm3"
+  },
+  {
+    "__type__": "sp.Skeleton",
+    "_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
+    },
+    "_skeletonData": {
+      "__uuid__": "6d70d1a2-07f3-4cf8-a149-a1fbfd7f02a4",
+      "__expectedType__": "sp.SkeletonData"
+    },
+    "defaultSkin": "default",
+    "defaultAnimation": "stand_right",
+    "_premultipliedAlpha": false,
+    "_timeScale": 1,
+    "_preCacheMode": 0,
+    "_cacheMode": 0,
+    "_sockets": [
+      {
+        "__id__": 7
+      }
+    ],
+    "_useTint": false,
+    "_debugMesh": false,
+    "_debugBones": false,
+    "_debugSlots": false,
+    "_enableBatch": false,
+    "loop": true,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "5f0h48yVBGZY0ahBHmjV3e"
+  },
+  {
+    "__type__": "sp.Skeleton.SpineSocket",
+    "path": "",
+    "target": null
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "18ZiTvpwpIWqAdAYs5FNI4",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "fightforce",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 10
+      },
+      {
+        "__id__": 12
+      }
+    ],
+    "_prefab": {
+      "__id__": 14
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 30,
+      "y": -30,
+      "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__": 9
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 11
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 18.69,
+      "height": 40
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "ffAQh9LAtB9pD2eiM3q0pP"
+  },
+  {
+    "__type__": "cc.Label",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 9
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 13
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_string": "1",
+    "_horizontalAlign": 1,
+    "_verticalAlign": 1,
+    "_actualFontSize": 26,
+    "_fontSize": 26,
+    "_fontFamily": "Arial",
+    "_lineHeight": 40,
+    "_overflow": 0,
+    "_enableWrapText": true,
+    "_font": {
+      "__uuid__": "65941af8-fc7e-447d-a557-0406909c778c",
+      "__expectedType__": "cc.BitmapFont"
+    },
+    "_isSystemFontUsed": false,
+    "_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": "24qHA3h5lNbrUG7T6ZIVfp"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "5diXWPbKRNhqJJ5UB/wt+P",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "Node",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 16
+      }
+    ],
+    "_prefab": {
+      "__id__": 18
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 47.125999999999976,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1.0000000000000038,
+      "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__": 15
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 17
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 100,
+      "height": 100
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "96cFqmKP1I1r2qUAsGp1K0"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "d54T+Jwk5IUIUtK6EFRTsO",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "click_box",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 20
+      }
+    ],
+    "_prefab": {
+      "__id__": 22
+    },
+    "_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__": 19
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 21
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 100,
+      "height": 100
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "fa8bVTxolHQZKhrAY1x1BA"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "50Hixedt5JfLFR+Jfv0bEl",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "Label",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 24
+      },
+      {
+        "__id__": 26
+      }
+    ],
+    "_prefab": {
+      "__id__": 28
+    },
+    "_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__": 23
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 25
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 102.3046875,
+      "height": 50.4
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "91+aLmR25O/5tRRkpm4Yaa"
+  },
+  {
+    "__type__": "cc.Label",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 23
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 27
+    },
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_string": "hero4",
+    "_horizontalAlign": 1,
+    "_verticalAlign": 1,
+    "_actualFontSize": 40,
+    "_fontSize": 40,
+    "_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": "342cWLb9xGtLO6i6EU7a6Q"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "1021Gqie9BUZQrOfh7iKFr",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 30
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 90,
+      "height": 90
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "c2aFUu6jBJg5uJ60FKMad/"
+  },
+  {
+    "__type__": "93e322oxm1M+7IXMqWiSdAA",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 32
+    },
+    "modelSpine": {
+      "__id__": 5
+    },
+    "levelLabel": {
+      "__id__": 12
+    },
+    "gunNode": {
+      "__id__": 15
+    },
+    "clickBox": {
+      "__id__": 20
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "5cADCscdNBYbIaIWYE2qFR"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "4cbne1jbpGk4QF3TRtbCOc",
+    "instance": null,
+    "targetOverrides": null
+  }
+]

+ 13 - 0
assets/package/prefab/ui/tower/hero/role401.prefab.meta

@@ -0,0 +1,13 @@
+{
+  "ver": "1.1.50",
+  "importer": "prefab",
+  "imported": true,
+  "uuid": "c2b8d76a-32ac-4bf4-8c17-620b72ca4484",
+  "files": [
+    ".json"
+  ],
+  "subMetas": {},
+  "userData": {
+    "syncNodeName": "role401"
+  }
+}

文件差异内容过多而无法显示
+ 442 - 209
assets/package/prefab/ui/tower/tower.prefab


+ 13 - 5
assets/script/game/common/LoginManager.ts

@@ -15,7 +15,7 @@ import { RoleData } from "../data/RoleData";
 import { AccountData } from "../data/AccountData";
 import { GoodsData } from "../data/GoodsData";
 import { EquipData } from "../data/EquipData";
-
+import { BattleData } from "../data/BattleData";
 
 const Macro = {
     cur_uuid: "cur_uuid",                   //当前用户uuid
@@ -199,6 +199,8 @@ export class LoginManager {
             if (data.fight_role) {
                 RoleData.setFightRole(data.fight_role)
             }
+            
+            BattleData.setLoginData(data)
 
             if (data.inventory) {
                 if (data.inventory.material) {
@@ -230,7 +232,7 @@ export class LoginManager {
             })
         }, args)
     }
-    sendPost(mod, act, backFun, argsObj?) {
+    sendPost(mod, act, backFun, argsObj?,errorFun?) {
 
         if (this._seq != this._last_seq + 1) {
             console.error(`sendPost seq error: seq ${this._seq},last_seq${this._last_seq}`)
@@ -253,6 +255,7 @@ export class LoginManager {
             act: act,
             back: backFun,
             args: args,
+            errorFun: errorFun
         }
         this.postList.push(postData)
 
@@ -371,9 +374,14 @@ export class LoginManager {
                         
                         this.autoOpenBox = false;
                     }
-                    this.errorCode(resp.code, resp.desc, () => {
-                        nextPostTask && nextPostTask();
-                    })
+                    if(postData.errorFun){
+                        postData.errorFun(resp.code, resp.desc);
+                    }
+                    else{
+                        this.errorCode(resp.code, resp.desc, () => {
+                            // nextPostTask && nextPostTask();
+                        })
+                    }
                     nextPostTask && nextPostTask();
                 }
             } else {

+ 149 - 0
assets/script/game/data/BattleData.ts

@@ -0,0 +1,149 @@
+import { Framework } from "../../framework/Framework";
+
+//位置数据拼接系数
+export let BattleLayoutScale = 10000
+
+export enum BattleLayoutPos {//战斗布局,f1-f15为出战区,b1-b15为后备区  value: 10000*raceID + level    
+    'b1',
+    'b2',
+    'b3',
+    'b4',
+    'b5',
+    'b6',
+    'b7',
+    'b8',
+    'b9',
+     'b10',
+     'b11',
+     'b12',
+     'b13',
+     'b14',
+     'b15',
+     'f1',                                    
+     'f2',
+     'f3',
+     'f4',
+     'f5',
+     'f6',
+     'f7',
+     'f8',
+     'f9',
+     'f10',
+     'f11',
+     'f12',
+     'f13',
+     'f14',
+     'f15',
+}
+
+export enum BattleOptsType{
+    //生成
+    New = 1,
+    //合成
+    Merge = 2,
+    //移动
+    Move = 3,
+    //销毁
+    Remove = 4,
+    //击杀敌人
+    Kill = 11,
+}
+
+export interface BattleOptsBase{
+    type:BattleOptsType;
+}
+
+export interface BattleOptsNew extends BattleOptsBase{
+    type:BattleOptsType.New;
+    //位置 BattleLayoutPos
+    pos:string;
+    //种族
+    raceID:number;
+    //等级
+    level:number;
+}
+
+export interface BattleOptsMerge extends BattleOptsBase{
+    type:BattleOptsType.Merge;
+    //目标位置
+    targetPos:string;
+    //源位置
+    srcPos:string;
+}
+
+export interface BattleOptsMove extends BattleOptsBase{
+    type:BattleOptsType.Move;
+    //目标位置
+    targetPos:string;
+    //源位置
+    srcPos:string;
+}
+
+export interface BattleOptsRemove extends BattleOptsBase{
+    type:BattleOptsType.Remove;
+    //位置
+    pos:string;
+}
+
+export interface BattleOptsKill extends BattleOptsBase{
+    type:BattleOptsType.Kill;
+    //敌人id
+    typeID:number;
+    //击杀数量
+    count:number;
+}
+
+export interface Duplicate{
+    chapter:number,                          // 当前解锁的最大章节编号(重置进新章节前更新)
+    max_process: number,                     // 主线进度(最大挑战成功的关卡id)
+    process: number,                         // 当前挂机进度(关卡id)
+    start_time: number,                    // 挂机时间  ?
+}
+
+export interface BattleLayoutData{
+    typeID: number;
+    raceID: number;
+    level: number;
+}
+
+class Data {
+    // 当前关卡数据
+    private _duplicate:Duplicate = null;
+    //
+    private _layout = []
+    //登录初始化数据
+    setLoginData(data){
+        if(data.duplicate){
+            this._duplicate = data.duplicate
+        }
+        if(data.layout){
+            this._layout = []
+            Object.values(BattleLayoutPos).forEach(value => {
+                const element = data.layout[value]
+                if(element != undefined){
+                    this._layout.push(element)
+                }
+            });
+
+        }
+    }
+
+    get duplicate(){
+        return this._duplicate
+    }
+    set duplicate(value){
+        this._duplicate = value
+    }
+
+    set layout(value){
+        this._layout = value
+    }
+    get layout(){
+        return this._layout
+    }
+
+    
+    
+}
+
+export let BattleData = new Data;

+ 1 - 1
assets/script/game/ui/tower/conf/HeroConf.ts.meta → assets/script/game/data/BattleData.ts.meta

@@ -2,7 +2,7 @@
   "ver": "4.0.24",
   "importer": "typescript",
   "imported": true,
-  "uuid": "e8003b64-4c25-414f-b1a3-5163c24e4d9a",
+  "uuid": "3751f2e4-d29a-459a-8824-49101cfa8531",
   "files": [],
   "subMetas": {},
   "userData": {}

+ 2 - 2
assets/script/game/data/RoleData.ts

@@ -64,8 +64,8 @@ class Data {
     }
 
     //获取出战角色
-    getFightRole(): [number, number, number, number] {
-        return [101, 201, 301, 401];
+    fightRole() :[number,number,number,number]{
+        return [101,201,301,401];
         // return this._fightRole;
     }
 

+ 37 - 11
assets/script/game/data/UserData.ts

@@ -1,3 +1,4 @@
+import { info } from "console";
 import { Framework } from "../../framework/Framework";
 import { ObjectUtil } from "../../framework/util/ObjectUtil";
 import { StringUtil } from "../../framework/util/StringUtil";
@@ -9,6 +10,18 @@ export const DataKey = {
     UserID: 'UserID',                       //用户ID
 };
 
+// 用户状态
+export interface UserStatus{
+    'xp': number,                                   // 基因实验室经验
+    'vip': number,                                  // VIP等级
+    'vip_xp':number,                                // vip经验点(可由充值或其他方式增加)
+    'level': number,                                // 等级
+    'gold': number,             // 金币
+    'cash': number,             // 蓝钻
+    'diamond':number,        // 红钻
+    'food': number,             // 能量点
+}
+
 
 class Data {
     private _class_id = StringUtil.getUUID(32);
@@ -17,24 +30,37 @@ class Data {
 
     UserID: any = null;
 
-
+    info: any = null;
+    mark: any = null;
+    //货币
+    status: UserStatus = null;
+    food_timer:number = 0;
 
     init(data: any) {
+        if(!data) return;
         Framework.storage.setUser(data._id);
+        if(data.info){
+            this.info = data.info;
+        }
+        if(data.mark){
+            this.mark = data.mark;
+        }
+        if(data.status){
+            this.status = data.status;
+        }
+
+        if(data.fool_timer){
+            this.food_timer = data.food_timer
+        }
         //将服务器的数据替换到本地
         // let save = new Map<string, string>();
-        for (let key in data) {
-            this[key] = data[key]
-            Framework.storage.set(key, this[key]);
-        }
+        // for (let key in data) {
+        //     this[key] = data[key]
+        //     Framework.storage.set(key, this[key]);
+        // }
         //读取本地数据
         //this.era = Framework.storage.get(DataKey.Era, GameConf.Macro.default_era);
-        //兼容代码
-        Framework.event.addEvent(GameEvent.Daily_Update, () => {
-            // Framework.event.fireEvent(GameEvent.Daily_Update);
-            //每日凌晨更新事件
-            //    
-        }, this, this._class_id);
+
 
     }
 

+ 126 - 0
assets/script/game/manager/BattleManager.ts

@@ -0,0 +1,126 @@
+import { LoginMgr } from "../common/LoginManager";
+import { BattleData, BattleLayoutData, BattleLayoutPos, BattleLayoutScale, BattleOptsBase, BattleOptsKill, BattleOptsMerge, BattleOptsMove, BattleOptsNew, BattleOptsRemove, BattleOptsType } from "../data/BattleData";
+import { RoleData } from "../data/RoleData";
+import { UserData } from "../data/UserData";
+//战斗消息管理
+export class BattleManager {
+    
+    /**
+     * 发送战斗结束消息
+     * @param id 新关卡id, 
+     * @param win 战斗结果(1-胜利,0-失败), 
+     * @param layout 布局信息, [key:BattleLayoutPos]:number
+     * @param opts 操作指令顺序数组
+     * @param callback 
+     */
+    static sendBattleDuplicateMsg(id:number,win:boolean,layout:{[key:string]:number},opts:Array<BattleOptsBase>, callback,errorFun) {
+        let args = {
+            id:id, //新关卡id, 
+            win:win?1:0, // 战斗结果(1-胜利,0-失败), 
+            layout:layout, //布局信息, 
+            opts:[], //操作指令顺序数组
+        }
+
+
+        for(let item of opts) {
+            switch(item.type) {
+                case BattleOptsType.New:{
+                    let item_new = item as BattleOptsNew;
+                    args.opts.push([item_new.type, item_new.pos,item_new.raceID,item_new.level]);
+                    break;
+                }
+                case BattleOptsType.Move:{
+                    let item_move = item as BattleOptsMove;
+                    args.opts.push([item_move.type, item_move.srcPos,item_move.targetPos]);
+                    break;
+                }
+                case BattleOptsType.Merge:{
+                    let item_merge = item as BattleOptsMerge;
+                    args.opts.push([item_merge.type, item_merge.srcPos,item_merge.targetPos]);
+                    break;
+                }
+                case BattleOptsType.Remove:{
+                    let item_remove = item as BattleOptsRemove;
+                    args.opts.push([item_remove.type, item_remove.pos]);
+                    break;
+                }
+                case BattleOptsType.Kill:{
+                    let item_kill = item as BattleOptsKill;
+                    args.opts.push([item_kill.type, item_kill.typeID, item_kill.count]);
+                    break;
+                }
+                
+            }
+        }
+
+        LoginMgr.sendPost('battle', 'duplicate', (data) => {
+            console.log(data);
+            if(data.duplicate){
+                BattleData.duplicate = data.duplicate;
+            }
+            if(data.layout){
+                BattleData.layout = data.layout;
+            }
+            UserData.food_timer = data.food_timer;
+            UserData.status.food = data.food;
+
+            callback&&callback();
+        }, args,errorFun)
+    }
+
+    // 重置新章节
+    static sendBattleDuplicateResetMsg(mapID:number,callback) {
+        let args = {
+            chapter_id:mapID, //章节id, 
+        }
+
+        LoginMgr.sendPost('battle', 'duplicate_reset', (data) => {
+            console.log(data);
+            callback&&callback();
+        }, args)
+    }
+
+    //领取章节奖励
+    static sendBattleDuplicateRewardMsg(mapID:number, callback) {
+        let args = {
+            chapter_id:mapID, //章节id
+        }
+
+        LoginMgr.sendPost('battle', 'duplicate', (data) => {
+            console.log(data);
+            for (const key in data.read_mails) {
+                if (Object.prototype.hasOwnProperty.call(data.read_mails, key)) {
+                    const element = data.read_mails[key];
+                    // MailData.setMailReadById(key);
+                    callback&&callback();
+                }
+            }
+        }, args)
+    }
+
+    //切换同种族角色
+    static sendBattleDuplicateFightRoleMsg(typeID:number, callback) {
+        let args = {
+            rid:typeID, //角色id
+        }
+
+        LoginMgr.sendPost('battle', 'set_fight_role', (data) => {
+            RoleData.setFightRole(data.fight_role);
+            callback&&callback();
+        }, args)
+    }
+
+    //根据布局数据获取类型ID
+    static getDataWithLayoutValue(value:number):BattleLayoutData{
+
+        let fightRole = RoleData.fightRole;
+        let level = value%BattleLayoutScale;
+		let raceID = (value-level)/BattleLayoutScale;
+        let typeID = fightRole[raceID];
+
+        
+        return {typeID: typeID,raceID: raceID,level: level}
+    }
+    
+
+}

+ 9 - 0
assets/script/game/manager/BattleManager.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.24",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "52d4aa07-a6c5-4658-8c54-3933ed626f17",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 1 - 0
assets/script/game/ui/hero/EquipOpreate.ts

@@ -1,5 +1,6 @@
 import { _decorator, Label, Node, tween, UIOpacity } from 'cc';
 import { BaseView } from '../../../framework/layer/BaseView';
+import { StringUtil } from '../../../framework/util/StringUtil';
 const { ccclass, property } = _decorator;
 
 @ccclass('EquipOpreate')

+ 1 - 1
assets/script/game/ui/login/LoginUI.ts

@@ -112,7 +112,7 @@ export class LoginUI extends BaseView {
 		Framework.audio.playMusic(AudioID.Game);
 
 		let uid = UserData.save_locally('UserID')
-		let choose_server = UserData.save_locally('choose_server', null, {})
+
 		let lastArea = UserData.save_locally('LastArea', null, '1');
 		AccountData.setAreanId(lastArea);
 		AccountData.setSid(UserData.save_locally('lastsid',null,-1),false)

+ 438 - 110
assets/script/game/ui/tower/TowerUI.ts

@@ -15,7 +15,7 @@ import { BattleEventManager } from './base/BattleEventManager';
 import { BattleEventData_EnemyBorn, BattleEventData_EnemyBuff, BattleEventData_EnemyDie, BattleEventData_EnemyHurt, BattleEventData_EnemyMove, BattleEventData_HeroAction, BattleEventData_HeroAttack, BattleEventData_Over, BattleEventTarget, BattleEventType, EnemyActionType, TowerUUID } from './base/BattleEventUtil';
 import { MapConf } from './conf/MapConf';
 import { isValid } from 'cc';
-import { HeroDataPool } from './data/HeroData';
+import { HeroDataPool, HeroRaceSacle } from './data/HeroData';
 import { StringUtil } from '../../../framework/util/StringUtil';
 import { MaterialUtil } from '../../../framework/util/MaterialUtil';
 import { BattlesConf } from './conf/BattlesConf';
@@ -25,6 +25,10 @@ import { MailManager } from '../../manager/MailManager';
 import { ViewID } from '../../../framework/config/LayerConf';
 import { MailData } from '../../data/MailData';
 import { RoleManager } from '../../manager/RoleManager';
+import { RoleData } from '../../data/RoleData';
+import { BattleData, BattleLayoutPos, BattleLayoutScale, BattleOptsBase, BattleOptsKill, BattleOptsMerge, BattleOptsMove, BattleOptsNew, BattleOptsRemove, BattleOptsType } from '../../data/BattleData';
+import { BattleManager } from '../../manager/BattleManager';
+import { UserData } from '../../data/UserData';
 
 //地图比例尺 1:70
 let mapScale = 72;
@@ -49,12 +53,18 @@ let MapDataSpeedToView = (x:number,y:number) => {
 
 const { ccclass, property } = _decorator;
 
+//可操作格子:背包格子和战斗格子
 export interface PosData {
+	//格子节点
 	node: Node,
+	//格子上的英雄
 	hero: Node,
+	//格子是否锁
 	bLock: boolean,
-	posID: number,
+	//格子下标
+	posIndex: number,
 	pos: Vec3,
+	//地图编号
 	posNumber: number
 }
 
@@ -81,9 +91,6 @@ export class TowerUI extends BaseView {
 	//背包位
 	bagPosList: PosData[] = [];
 
-	@property({ type: [Prefab], tooltip: "英雄" })
-	heroModelList: Prefab[] = [];
-	heroPool: Map<number,Node[]> = new Map();
 	heroList: Node[] = [];
 	@property({type:[Node],tooltip:"升级效果"})
 	levelUpEffect:Node[] = []
@@ -123,6 +130,9 @@ export class TowerUI extends BaseView {
 	bStart = false;
 	waitTime = 5;
 	touchStart: Node = null;
+	//记录连击
+	touchEndIndex = -1;
+	touchEndTime = 0;
 	gameTime = 0;
 
 	//当前精力
@@ -141,6 +151,23 @@ export class TowerUI extends BaseView {
 	levelUpEffectIndex = 0;
 	//是否自动合成
 	isAutoMerge = false;
+	//英雄处理-------
+	//英雄模型加载数量
+	loadHeroModelNum: number = 0;
+	//英雄模型加载数量上限
+	loadHeroModelNumMax: number = -1;
+	heroModelMap:Map<number,Prefab> = new Map();
+	heroPool: Map<number,Node[]> = new Map();
+	//出战角色
+	fightRole = [0,0,0,0]
+	//锁定格子
+	lockBagPosNumber = 6;
+	lockAttackPosNumber = 8;
+
+	//操作指令集  记录下来发给服务器
+	operateList:Array<BattleOptsBase> = [];
+
+
 
 	protected onLoad() {
 		super.onLoad();
@@ -160,6 +187,7 @@ export class TowerUI extends BaseView {
 
 		Framework.event.addEvent(GameEvent.BossUpdate, this.bossUpdate.bind(this),this)
 		
+		
 		this.initPool()
 	}
 	protected start(): void {
@@ -218,6 +246,13 @@ export class TowerUI extends BaseView {
 				this.bStart = true;
 			}
 		}
+
+		if(this.touchEndTime > 0){
+			this.touchEndTime -= dt;
+			if(this.touchEndTime <= 0){
+				this.touchEndIndex = -1;
+			}
+		}
 	}
 
 
@@ -256,6 +291,7 @@ export class TowerUI extends BaseView {
 			case BattleEventType.EnemyDie:{
 				// console.log("死亡",event)
 				let enemyData = event as BattleEventData_EnemyDie;
+
 				if(this.enemyMap.has(enemyData.ID)){
 					let enemy = this.enemyMap.get(enemyData.ID);
 					enemy.getComponent(Enemy).die(()=>{
@@ -272,6 +308,13 @@ export class TowerUI extends BaseView {
 						}
 					);
 				}
+				//记录击杀敌人的操作
+				let otps:BattleOptsKill = {
+					count:1,
+					type:BattleOptsType.Kill,
+					typeID:enemyData.typeID
+				}
+				this.operateList.push(otps);
 				break;
 			}
 			case BattleEventType.EnemyBuff:{
@@ -338,32 +381,59 @@ export class TowerUI extends BaseView {
 					
 				let winStr = attackData.bWin ? "胜利" : "失败";
 				console.log(winStr)
+				if(attackData.bWin){
+
+					let layout = {}
+					for(let index = 0; index < this.bagPosList.length; index++){
+						let posData = this.bagPosList[index]
+						let key = BattleLayoutPos[index]
+						layout[key] = 0
+						if(posData.hero){
+							let heroData = posData.hero.getComponent(Hero)
+							let value = heroData.level + heroData.raceID *BattleLayoutScale
+							if(key){
+								layout[key] = value
+							}
+						}
+						
+					}
 
-				tween(this.node).delay(3).call(()=>{
-					this.enemyMap.forEach((enemy, enemyID) => {
-						enemy.getComponent(Enemy).clearData();
-						this.enemyMap.delete(enemyID);
-						let typeID = enemy.getComponent(Enemy).typeID
-						if(this.enemyPool.has(typeID)){
-							this.enemyPool.get(typeID).push(enemy);
+					//战场占位数量跟背包一样
+					for(let index = 0; index < BattleUtil.BagListSize; index++){
+						let posData = this.attackPosList[index]
+						let key = BattleLayoutPos[index+BattleUtil.BagListSize]
+						if(key){
+							if(posData && posData.hero){
+								let heroData = posData.hero.getComponent(Hero)
+								let value = heroData.level + heroData.raceID *BattleLayoutScale
+								layout[key] = value
+							}
+							else{
+								layout[key] = 0
+							}
 						}
-						else {
-							this.enemyPool.set(typeID,[enemy]);
+					}
+
+					BattleManager.sendBattleDuplicateMsg(this.battlesID,attackData.bWin,layout,this.operateList,()=>{
+						if(this.battlesID == 20){
+							this.reStartBattle(this.battlesID)
 						}
-					})
-					this.battlesID = (this.battlesID+3) %20+1;
-					this.battleControl.reset(this.battlesID)
-				  	this.reset()  
-
-					for(let index = 0; index < this.attackPosList.length; index++){
-						let hero  = this.attackPosList[index].hero;
-						if(hero){
-							hero.position = this.attackPosList[index].pos;
-							let heroObj = hero.getComponent(Hero)
-							this.battleControl.addHeroInPos(heroObj.typeID,heroObj.level,index)
+						else{
+							this.reStartBattle(this.battlesID+1)
 						}
+					},()=>{
+						this.reStartBattle(this.battlesID)
+					})
+				}
+				else{
+					if(this.battlesID%5 != 1){
+						this.reStartBattle(this.battlesID-1)
 					}
-				}).start();
+					else{
+						this.reStartBattle(this.battlesID)
+					}
+				}
+				
 				break;
 			}
 		}
@@ -385,7 +455,7 @@ export class TowerUI extends BaseView {
 			this.touchStart = posData.hero;
 			hero.stand() 
 			this.touchStart.setSiblingIndex(30);
-			let index = posData.posID - BattleUtil.BagListSize
+			let index = posData.posIndex - BattleUtil.BagListSize
 			if(index >= 0){
 				this.battleControl.removeHeroInPos(index)
 			}
@@ -397,7 +467,7 @@ export class TowerUI extends BaseView {
 		if (this.touchStart ) {
 			this.touchStart .setPosition(this.roleNode.getComponent(UITransform).convertToNodeSpaceAR(new Vec3(event.getUILocation().x, event.getUILocation().y)))
 			let posData = this.getItemBaseByPosition(event.getLocation());
-			if(posData&&(posData.posID >= BattleUtil.BagListSize)){
+			if(posData&&(posData.posIndex >= BattleUtil.BagListSize)){
 				this.radiusNode.position = v3(this.touchStart.position.x,this.touchStart.position.y);
 				this.radiusNode.active = true;
 				this.setRadius(this.touchStart.getComponent(Hero).radius)
@@ -416,22 +486,39 @@ export class TowerUI extends BaseView {
 		if (this.touchStart) {
 			let posData = this.getItemBaseByPosition(event.getLocation());
 			let touchEnd:Node = null
-			if(posData &&  posData.hero != this.touchStart){
-				
-				if(posData.hero){
-					let hero = posData.hero.getComponent(Hero);
-					if(hero && hero.isLock){
-						this.resetHeroPos(this.touchStart)
-						this.touchStart = null;
-						return;
+			if(posData){
+				if(posData.hero == this.touchStart){
+					if(this.touchEndIndex == posData.posIndex){
+						this.touchEndIndex = -1
+						if(posData.posIndex < BattleUtil.BagListSize){
+							this.removeHeroPos(this.touchStart,true)
+							this.touchStart = null;
+							return;
+						}
+					}
+					else{
+						this.touchEndIndex = posData.posIndex
+						this.touchEndTime = 1
 					}
 				}
-				
-				touchEnd = posData.hero;
+				else{
+					if(posData.hero){
+						let hero = posData.hero.getComponent(Hero);
+						if(hero && hero.isLock){
+							this.resetHeroPos(this.touchStart)
+							this.touchStart = null;
+							return;
+						}
+					}
+					
+					touchEnd = posData.hero;
+					this.touchEndIndex = -1
+				}
 			}
 			else{
 				this.resetHeroPos(this.touchStart)
 				this.touchStart = null;
+				this.touchEndIndex = -1
 				return 
 			}
 			if(touchEnd){
@@ -446,7 +533,7 @@ export class TowerUI extends BaseView {
 
 			}
 			else{
-				this.setHeroPos(this.touchStart, posData.posID)
+				this.setHeroPos(this.touchStart, posData.posIndex)
 			}
 			this.touchStart = null;
 		}
@@ -465,6 +552,7 @@ export class TowerUI extends BaseView {
 		let FindArr = this.bagPosList
 
 		let bag =  FindArr.find(t => {
+			if(t.bLock) return false
 			if(t.hero && t.hero != this.touchStart){
 				return t.hero.getComponent(Hero).hitTest(pos)
 			}
@@ -523,7 +611,7 @@ export class TowerUI extends BaseView {
 				node: node,
 				hero: null,
 				bLock: false,
-				posID: posID,
+				posIndex: posID,
 				pos: pos,
 				posNumber: -1
 			}
@@ -533,6 +621,8 @@ export class TowerUI extends BaseView {
 		}
 
 		this.reset()
+
+		
 	}
 
 	reset(){
@@ -542,6 +632,8 @@ export class TowerUI extends BaseView {
 			console.log("战斗配置错误")
 			return
 		}
+
+		this.lockAttackPosNumber = BattleUtil.AttackListSize-battleConf.Unlock
 		
 		let mapConf = MapConf.data[this.battleControl.mapID.toString()]
 		if(!mapConf){
@@ -558,35 +650,69 @@ export class TowerUI extends BaseView {
 			baseOffset.y = 0
 		}
 		let attackChildren = this.attackNode.children
-		for (let i = 0; i < attackChildren.length; i++) {
+		let attackNode = this.attackNode.children[0]
+		// this.attackPosList = []
+		this.attackPosMap.clear()
+
+		for (let i = 0; i < BattleUtil.BagListSize; i++) {
+			let posData = this.bagPosList[i];
+			if(i < BattleUtil.BagListSize-this.lockBagPosNumber){
+				posData.node.getChildByName("lock").active = false
+				posData.bLock = false
+			}
+			else{
+				posData.bLock = true
+				posData.node.getChildByName("lock").active = true
+			}
+		}
+
+
+		for (let i = 0; i < BattleUtil.AttackListSize; i++) {
 			let node = attackChildren[i];
+			if(!node){
+				node = instantiate(attackNode)
+				this.attackNode.addChild(node)
+			} 
+
 			let posNumber = this.battleControl.getPosIDByIndex(i)
 			if(posNumber != -1){
 				node.active = true;
 				let mapDataPos = this.battleControl.getPosition(posNumber)
-				let posXX = MapDataPosToView(mapDataPos.x,mapDataPos.y)
-				node.position = posXX
+				let pos = MapDataPosToView(mapDataPos.x,mapDataPos.y)
+				node.position = pos
 				let posData: PosData = this.attackPosList[i]
-				if(!posData){
-					posData = {
-						node: node,
-						hero: null,
-						bLock: false,
-						posID: BattleUtil.BagListSize+i,
-						pos: new Vec3(posXX.x, posXX.y, 0),
-						posNumber: posNumber
+				if(i < BattleUtil.AttackListSize-this.lockAttackPosNumber){
+					node.getChildByName("lock").active = false
+					if(!posData){
+						posData = {
+							node: node,
+							hero: null,
+							bLock: false,
+							posIndex: BattleUtil.BagListSize+i,
+							pos: new Vec3(pos.x, pos.y, 0),
+							posNumber: posNumber
+						}
+						this.attackPosList.push(posData);
 					}
-					this.attackPosList.push(posData);
+					else{
+						posData.posIndex = BattleUtil.BagListSize+i;
+						posData.pos = new Vec3(pos.x, pos.y, 0);
+						posData.posNumber = posNumber;
+						if(posData.hero){
+							posData.hero.position = posData.pos;
+						}
+					}
+					this.attackPosMap.set(posNumber, posData);
 				}
 				else{
-					posData.posID = BattleUtil.BagListSize+i;
-					posData.pos = new Vec3(posXX.x, posXX.y, 0);
-					posData.posNumber = posNumber;
-					if(posData.hero){
-						posData.hero.position = posData.pos;
+					if(posData){
+						if(posData.hero){
+							posData.hero.removeFromParent();
+						}
+						this.attackPosList.splice(i);
 					}
+					node.getChildByName("lock").active = true
 				}
-				this.attackPosMap.set(posNumber, posData);
 			}
 			else {
 				node.active = false;
@@ -614,6 +740,7 @@ export class TowerUI extends BaseView {
 		this.bStart = false;
 		this.waitTime = 5;
 		this.gameTime = 0;
+		this.powerCur = UserData.status.food
 		this.radiusNode.active = false;
 		this.damageCountData.clear()
 		this.updateDamageCount()
@@ -641,18 +768,27 @@ export class TowerUI extends BaseView {
 		queue.play();
 
 		//this._loginEx();
+		this.loadHeroModel()
 	}
 
 
+	//添加一个新英雄
 	addHero() {
+		
+		if(this.loadHeroModelNum < this.loadHeroModelNumMax){
+			console.log("英雄没加载完成");
+			return;
+		}
 		let posID = -1;
 		if(this.powerCur <= 0){
 			console.log("没有精力了");
 			return;
 		}
+
 		for (let i = 0; i < BattleUtil.BagListSize; i++) {
-			if(this.bagPosList[i].hero == null){
-				posID = this.bagPosList[i].posID;
+			let bagPos = this.bagPosList[i];
+			if(!bagPos.bLock && bagPos.hero == null){
+				posID = this.bagPosList[i].posIndex;
 				break;
 			}
 		}
@@ -662,9 +798,12 @@ export class TowerUI extends BaseView {
 		}
 		
 		//添加英雄
-		let heroID = Math.floor(Math.random() * this.heroModelList.length)%this.heroModelList.length + 1;
+
+
+		let heroIndex = Math.floor(Math.random() * this.loadHeroModelNum)%this.loadHeroModelNum;
+		let heroID = this.fightRole[heroIndex];
 		let heroData = HeroDataPool.getObject();
-		heroData.init(heroID,1,posID)
+		heroData.init(heroID,1,1)
 		
 		let node:Node = null;
 		if(this.heroPool[heroID] == null){
@@ -676,7 +815,7 @@ export class TowerUI extends BaseView {
 			}
 		}
 		if(node == null){
-			node = instantiate(this.heroModelList[heroID-1]);
+			node = instantiate(this.heroModelMap.get(heroID));
 			node.parent = this.roleNode;
 			this.heroList.push(node);
 		}
@@ -685,7 +824,7 @@ export class TowerUI extends BaseView {
 		hero.resetData(heroData);
 		HeroDataPool.putObject(heroData);
 		
-		hero.posID = posID;
+		hero.posIndex = posID;
 		let posData = this.bagPosList[posID];
 		if(!posData){
 			return;
@@ -693,13 +832,79 @@ export class TowerUI extends BaseView {
 		posData.hero = node;
 		
 		node.position = posData.pos;
+
+		//记录添加英雄操作
+		let otps:BattleOptsNew ={
+			type:BattleOptsType.New,
+			pos:BattleLayoutPos[posData.posIndex],
+			level:1,
+			raceID:Math.floor(heroData.typeID/HeroRaceSacle),
+		
+		} 
+		this.operateList.push(otps);
+
 		console.log("添加英雄", node.position);
 		this.powerLabel.string = `${this.powerCur}/${this.powerMax}`;
 		this.powerCur--;
 		
 		this.checkMerge(node);
 
-	}	
+	}
+	/**
+	 * 添加一个已有数据的英雄
+	 * @param typeID 类型
+	 * @param level 等级
+	 * @param posIndex 所处位置下标
+	 * @returns 
+	 */
+	addHeroWithData( typeID:number,level:number, posIndex:number) {
+
+		//添加英雄
+		if(this.loadHeroModelNum < this.loadHeroModelNumMax){
+			console.log("英雄没加载完成");
+			return;
+		}
+
+		// let heroIndex = Math.floor(Math.random() * this.loadHeroModelNum)%this.loadHeroModelNum;
+		let heroID = typeID;
+		let heroData = HeroDataPool.getObject();
+		heroData.init(heroID,1,1)
+		
+		let node:Node = null;
+		if(this.heroPool[heroID] == null){
+			this.heroPool[heroID] = [];
+		}
+		else {
+			if(this.heroPool[heroID].length > 0){
+				node = this.heroPool[heroID].pop();
+			}
+		}
+		if(node == null){
+			node = instantiate(this.heroModelMap.get(heroID));
+			node.parent = this.roleNode;
+			this.heroList.push(node);
+		}
+		
+		let hero = node.getComponent(Hero);
+		hero.resetData(heroData);
+		HeroDataPool.putObject(heroData);
+		
+		hero.posIndex = posIndex;
+		let posData = this.bagPosList[posIndex];
+		if(!posData){
+			posData = this.attackPosList[posIndex-BattleUtil.BagListSize];
+			this.battleControl.addHeroInPos(hero.typeID,hero.level,posIndex - BattleUtil.BagListSize)
+		}
+		if(!posData){
+			return;
+		}
+		posData.hero = node;
+		
+		node.position = posData.pos;
+
+		
+
+	}
 
 	checkMerge(node:Node) {
 		let hero = node.getComponent(Hero);
@@ -707,7 +912,7 @@ export class TowerUI extends BaseView {
 			return;
 		}
 		let bFind = false;
-	    if(this.isAutoMerge && !hero.isLock && hero.posID < BattleUtil.BagListSize){
+	    if(this.isAutoMerge && !hero.isLock && hero.posIndex < BattleUtil.BagListSize){
 			for (let i = 0; i < this.attackPosList.length; i++) {
 			    let dstPosData = this.attackPosList[i];
 				if(dstPosData.hero != null && dstPosData.hero != node){
@@ -753,8 +958,8 @@ export class TowerUI extends BaseView {
 			if(isValid(dstHero)){
 				dstHero.isLock = false;
 				dstHero.levelUp()
-				if(dstHero.posID >= BattleUtil.BagListSize){
-					let index = dstHero.posID - BattleUtil.BagListSize;
+				if(dstHero.posIndex >= BattleUtil.BagListSize){
+					let index = dstHero.posIndex - BattleUtil.BagListSize;
 					this.battleControl.levelUp(index)
 				}
 				this.levelUpEffectIndex = this.levelUpEffectIndex++%this.levelUpEffect.length;
@@ -766,6 +971,15 @@ export class TowerUI extends BaseView {
 				this.checkMerge(dstNode)
 			}
 		})
+
+		//记录合并英雄操作
+		let opts:BattleOptsMerge = {
+			type:BattleOptsType.Merge,
+			srcPos:BattleLayoutPos[srcNode.getComponent(Hero).posIndex],
+			targetPos:BattleLayoutPos[dstHero.posIndex],
+		}
+		this.operateList.push(opts)
+		
 		return true;
 	}
 
@@ -807,7 +1021,7 @@ export class TowerUI extends BaseView {
 		if(!hero) {
 			return;
 		}
-		let posID = hero.posID;
+		let posID = hero.posIndex;
 		if(posID != -1){
 			if(posID < BattleUtil.BagListSize)
 				heroNode.position = this.bagPosList[posID].pos;
@@ -819,64 +1033,99 @@ export class TowerUI extends BaseView {
 	}
 
 	//设置新坐标
-	setHeroPos(hero:Node,newPosID:number) {
-		let posID = hero.getComponent(Hero).posID;
-		if(posID != -1){
-			if(posID < BattleUtil.BagListSize)
-				this.bagPosList[posID].hero = null;
-			else if(posID < BattleUtil.BagListSize + this.attackPosList.length){
-				this.attackPosList[posID - BattleUtil.BagListSize].hero = null;
+	setHeroPos(hero:Node,newPosIndex:number) {
+		let posIndex = hero.getComponent(Hero).posIndex;
+		if(posIndex != -1){
+			if(posIndex < BattleUtil.BagListSize){
+				this.bagPosList[posIndex].hero = null;
+				// console.log("setHeroPos1",posID)
+			}else if(posIndex < BattleUtil.BagListSize + this.attackPosList.length){
+				this.attackPosList[posIndex - BattleUtil.BagListSize].hero = null;
+				// console.log("setHeroPos2",posID)
 				
 				
 			}
 		}
+		else{
+			console.error("setHeroPos error",posIndex)
+			return;
+		}
 
-		if(newPosID != -1){
-			if(newPosID < BattleUtil.BagListSize){
-				this.bagPosList[newPosID].hero = hero;
-				hero.position = this.bagPosList[newPosID].pos;
+		if(newPosIndex != -1){
+			if(newPosIndex < BattleUtil.BagListSize){
+				this.bagPosList[newPosIndex].hero = hero;
+				hero.position = this.bagPosList[newPosIndex].pos;
 			}
-			else if(newPosID < BattleUtil.BagListSize + this.attackPosList.length){
-				let index = newPosID - BattleUtil.BagListSize;
+			else if(newPosIndex < BattleUtil.BagListSize + this.attackPosList.length){
+				let index = newPosIndex - BattleUtil.BagListSize;
 				this.attackPosList[index].hero = hero;
 				hero.position = this.attackPosList[index].pos;
 				let heroObj = hero.getComponent(Hero)
 				this.battleControl.addHeroInPos(heroObj.typeID,heroObj.level,index)
 			}
-			hero.getComponent(Hero).posID = newPosID
+			hero.getComponent(Hero).posIndex = newPosIndex
+		}
+		else{
+			console.log("hero move error")
+			return
 		}
+
+		//记录交换操作
+		let opts:BattleOptsMove = {
+			type: BattleOptsType.Move,
+			targetPos: BattleLayoutPos[newPosIndex],
+			srcPos: BattleLayoutPos[posIndex],
+		}
+		this.operateList.push(opts)
 		
 	}
 
-	removeHeroPos(hero:Node) {
-		let posID = hero.getComponent(Hero).posID;
-		if(posID != -1){
+	/**
+	 * 移除英雄
+	 * @param hero 节点 
+	 * @param bOtps 是否记录此次移除操作
+	 */
+	removeHeroPos(hero:Node,bOtps:boolean = false) {
+		let posIndex = hero.getComponent(Hero).posIndex;
+		if(posIndex != -1){
 			this.heroList.splice(this.heroList.indexOf(hero), 1)
 			this.heroPool[hero.getComponent(Hero).typeID].push(hero)
 			hero.getComponent(Hero).clearData();
-			if(posID < BattleUtil.BagListSize)
-				this.bagPosList[posID].hero = null;
-			else if(posID < BattleUtil.BagListSize + this.attackPosList.length){
-				this.attackPosList[posID - BattleUtil.BagListSize].hero = null;
-				this.battleControl.removeHeroInPos(posID - BattleUtil.BagListSize)
+			if(posIndex < BattleUtil.BagListSize){	
+				this.bagPosList[posIndex].hero = null;
+				// console.log("removeHeroPos1",posID)
+			}else if(posIndex < BattleUtil.BagListSize + this.attackPosList.length){
+				this.attackPosList[posIndex - BattleUtil.BagListSize].hero = null;
+				// console.log("removeHeroPos2",posID)
+				this.battleControl.removeHeroInPos(posIndex - BattleUtil.BagListSize)
+			}
+
+			if(bOtps){
+				let otps:BattleOptsRemove = {
+					pos:BattleLayoutPos[posIndex],
+					type:BattleOptsType.Remove
+				}
+				this.operateList.push(otps)
 			}
 		}
 	}
 
+	//交换位置
 	changeHeroPos(hero1:Node,hero2:Node) {
-		let posID1 = hero1.getComponent(Hero).posID;
-		let posID2 = hero2.getComponent(Hero).posID;
-		hero1.getComponent(Hero).posID = posID2
-		hero2.getComponent(Hero).posID = posID1
-
-		if(posID1 != -1){
-			if(posID1 < BattleUtil.BagListSize){
-				hero2.position = this.bagPosList[posID1].pos;
-				this.bagPosList[posID1].hero = hero2;
+		let posIndex1 = hero1.getComponent(Hero).posIndex;
+		let posIndex2 = hero2.getComponent(Hero).posIndex;
+		hero1.getComponent(Hero).posIndex = posIndex2
+		hero2.getComponent(Hero).posIndex = posIndex1
+
+		
+		if(posIndex1 != -1){
+			if(posIndex1 < BattleUtil.BagListSize){
+				hero2.position = this.bagPosList[posIndex1].pos;
+				this.bagPosList[posIndex1].hero = hero2;
 			}
-			else if(posID1 < BattleUtil.BagListSize + this.attackPosList.length){
-				hero2.position =  this.attackPosList[posID1 - BattleUtil.BagListSize].pos;
-				let index = posID1 - BattleUtil.BagListSize;
+			else if(posIndex1 < BattleUtil.BagListSize + this.attackPosList.length){
+				hero2.position =  this.attackPosList[posIndex1 - BattleUtil.BagListSize].pos;
+				let index = posIndex1 - BattleUtil.BagListSize;
 				this.attackPosList[index].hero = hero2;
 				let heroObj = hero2.getComponent(Hero)
 				this.battleControl.addHeroInPos(heroObj.typeID,heroObj.level,index)
@@ -884,21 +1133,31 @@ export class TowerUI extends BaseView {
 			hero2.getComponent(Hero).stand()
 		}
 
-		if(posID2 != -1){
-			if(posID2 < BattleUtil.BagListSize){
-				hero1.position = this.bagPosList[posID2].pos;
-				this.bagPosList[posID2].hero = hero1;
+		if(posIndex2 != -1){
+			if(posIndex2 < BattleUtil.BagListSize){
+				hero1.position = this.bagPosList[posIndex2].pos;
+				this.bagPosList[posIndex2].hero = hero1;
 			}
-			else if(posID2 < BattleUtil.BagListSize + this.attackPosList.length){
-				hero1.position =  this.attackPosList[posID2 - BattleUtil.BagListSize].pos;
-				let index = posID2 - BattleUtil.BagListSize;
+			else if(posIndex2 < BattleUtil.BagListSize + this.attackPosList.length){
+				hero1.position =  this.attackPosList[posIndex2 - BattleUtil.BagListSize].pos;
+				let index = posIndex2 - BattleUtil.BagListSize;
 				this.attackPosList[index].hero = hero1;
 				let heroObj = hero1.getComponent(Hero)
 				this.battleControl.addHeroInPos(heroObj.typeID,heroObj.level,index)
 			}
 			hero1.getComponent(Hero).stand()
+
+			
 		}
 
+		
+			//记录交换操作
+			let opts:BattleOptsMove = {
+				type: BattleOptsType.Move,
+				targetPos: BattleLayoutPos[posIndex2],
+				srcPos: BattleLayoutPos[posIndex1],
+			}
+			this.operateList.push(opts)
 	}
 
 	addHurt(pos:Vec3,value:number){
@@ -1043,4 +1302,73 @@ export class TowerUI extends BaseView {
 		}
 	}
 
+	private loadHeroModel(){
+		let fightRole = RoleData.fightRole
+		this.fightRole = fightRole
+		this.loadHeroModelNum = 0
+		this.loadHeroModelNumMax = 0
+		fightRole.forEach(element => {
+
+			if(element > 0 ){
+				this.loadHeroModelNumMax ++
+				if(!this.heroModelMap.has(element)){
+					let url = "prefab/ui/tower/hero/role"+element
+					this.load("package",url,Prefab,(prefab:Prefab)=>{
+						this.heroModelMap.set(element,prefab)
+						this.loadHeroModelNum++
+						if(this.loadHeroModelNum == this.loadHeroModelNumMax){
+							this.resetBattleLayout()
+						}
+					})
+				}
+				else{
+					this.loadHeroModelNum++
+				}
+			}
+			
+			
+		});
+
+	}
+
+
+	private resetBattleLayout(){
+
+		//添加初始英雄
+		for (let i = 0; i < BattleData.layout.length; i++) {
+			let value = BattleData.layout[i];
+			if(value > 0){
+				let battleLayoutData = BattleManager.getDataWithLayoutValue(value)
+				this.addHeroWithData(battleLayoutData.typeID,battleLayoutData.level,i)
+			}
+		}
+	}
+
+
+	//重新开始第x关
+	private reStartBattle(battlesID){
+		this.enemyMap.forEach((enemy, enemyID) => {
+			enemy.getComponent(Enemy).clearData();
+			this.enemyMap.delete(enemyID);
+			let typeID = enemy.getComponent(Enemy).typeID
+			if(this.enemyPool.has(typeID)){
+				this.enemyPool.get(typeID).push(enemy);
+			}
+			else {
+				this.enemyPool.set(typeID,[enemy]);
+			}
+		})
+		this.battlesID = battlesID;
+		this.battleControl.reset(this.battlesID)
+		this.reset()  
+
+		for(let index = 0; index < this.attackPosList.length; index++){
+			let hero  = this.attackPosList[index].hero;
+			if(hero){
+				hero.position = this.attackPosList[index].pos;
+				let heroObj = hero.getComponent(Hero)
+				this.battleControl.addHeroInPos(heroObj.typeID,heroObj.level,index)
+			}
+		}
+	}
 }

+ 12 - 12
assets/script/game/ui/tower/ZombieUI.ts

@@ -631,7 +631,7 @@ export class ZombieUI extends BaseView {
 		//用完就还
 		ZombieHeroDataPool.putObject(heroData);
 
-		hero.posID = posID;
+		hero.posIndex = posID;
 		let posData = this.bagPosList[posID];
 		if(!posData){
 		    return;
@@ -651,7 +651,7 @@ export class ZombieUI extends BaseView {
 			return;
 		}
 		let bFind = false;
-	    if(this.isAutoMerge && !hero.isLock && hero.posID < this.bagPosList.length){
+	    if(this.isAutoMerge && !hero.isLock && hero.posIndex < this.bagPosList.length){
 			for (let i = 0; i < this.attackPosList.length; i++) {
 			    let dstPosData = this.attackPosList[i];
 				if(dstPosData.hero != null && dstPosData.hero != node){
@@ -697,8 +697,8 @@ export class ZombieUI extends BaseView {
 			if(isValid(dstHero)){
 				dstHero.isLock = false;
 				dstHero.levelUp()
-				if(dstHero.posID >= this.bagPosList.length){
-					let index = dstHero.posID - this.bagPosList.length;
+				if(dstHero.posIndex >= this.bagPosList.length){
+					let index = dstHero.posIndex - this.bagPosList.length;
 					this.battleControl.levelUp(index)
 				}
 				this.levelUpEffectIndex = this.levelUpEffectIndex++%this.levelUpEffect.length;
@@ -752,7 +752,7 @@ export class ZombieUI extends BaseView {
 		if(!hero) {
 			return;
 		}
-		let posID = hero.posID;
+		let posID = hero.posIndex;
 		if(posID != -1){
 			if(posID < this.bagPosList.length)
 				heroNode.position = this.bagPosList[posID].pos;
@@ -765,7 +765,7 @@ export class ZombieUI extends BaseView {
 
 	//设置新坐标
 	setHeroPos(hero:Node,newPosID:number) {
-		let posID = hero.getComponent(Hero).posID;
+		let posID = hero.getComponent(Hero).posIndex;
 		if(posID != -1){
 			if(posID < this.bagPosList.length)
 				this.bagPosList[posID].hero = null;
@@ -788,13 +788,13 @@ export class ZombieUI extends BaseView {
 				let heroObj = hero.getComponent(Hero)
 				this.battleControl.addHeroInPos(heroObj.typeID,heroObj.level,index)
 			}
-			hero.getComponent(Hero).posID = newPosID
+			hero.getComponent(Hero).posIndex = newPosID
 		}
 		
 	}
 
 	removeHeroPos(hero:Node) {
-		let posID = hero.getComponent(Hero).posID;
+		let posID = hero.getComponent(Hero).posIndex;
 		if(posID != -1){
 			this.heroList.splice(this.heroList.indexOf(hero), 1)
 			this.heroPool[hero.getComponent(Hero).typeID].push(hero)
@@ -809,10 +809,10 @@ export class ZombieUI extends BaseView {
 	}
 
 	changeHeroPos(hero1:Node,hero2:Node) {
-		let posID1 = hero1.getComponent(Hero).posID;
-		let posID2 = hero2.getComponent(Hero).posID;
-		hero1.getComponent(Hero).posID = posID2
-		hero2.getComponent(Hero).posID = posID1
+		let posID1 = hero1.getComponent(Hero).posIndex;
+		let posID2 = hero2.getComponent(Hero).posIndex;
+		hero1.getComponent(Hero).posIndex = posID2
+		hero2.getComponent(Hero).posIndex = posID1
 
 		if(posID1 != -1){
 			if(posID1 < this.bagPosList.length){

+ 1 - 0
assets/script/game/ui/tower/base/BattleEventUtil.ts

@@ -108,6 +108,7 @@ export interface BattleEventData_EnemyHurt extends BattleEventData{
 
 export interface BattleEventData_EnemyDie extends BattleEventData{
     eventType:BattleEventType.EnemyDie;
+    typeID:number;
     ID:number;
 }
 //英雄开始做动作

+ 499 - 479
assets/script/game/ui/tower/conf/BattlesConf.ts

@@ -1,480 +1,500 @@
 export namespace BattlesConf {
-    export const data = {
-        "1": {
-                "Id": 1,
-                "Chapter": 1,
-                "Process": 1,
-                "BossProcess": 10,
-                "EnemyLevel": 1,
-                "BossJsonArr": null,
-                "NewReward": [
-                        [
-                                "user",
-                                "gold",
-                                10
-                        ],
-                        [
-                                "user",
-                                "cash",
-                                10
-                        ]
-                ]
-        },
-        "2": {
-                "Id": 2,
-                "Chapter": 1,
-                "Process": 2,
-                "BossProcess": 10,
-                "EnemyLevel": 1.2,
-                "BossJsonArr": null,
-                "NewReward": [
-                        [
-                                "user",
-                                "gold",
-                                10
-                        ],
-                        [
-                                "user",
-                                "cash",
-                                10
-                        ]
-                ]
-        },
-        "3": {
-                "Id": 3,
-                "Chapter": 1,
-                "Process": 3,
-                "BossProcess": 10,
-                "EnemyLevel": 1.2,
-                "BossJsonArr": null,
-                "NewReward": [
-                        [
-                                "user",
-                                "gold",
-                                10
-                        ],
-                        [
-                                "user",
-                                "cash",
-                                10
-                        ]
-                ]
-        },
-        "4": {
-                "Id": 4,
-                "Chapter": 1,
-                "Process": 4,
-                "BossProcess": 10,
-                "EnemyLevel": 1.2,
-                "BossJsonArr": null,
-                "NewReward": [
-                        [
-                                "user",
-                                "gold",
-                                10
-                        ],
-                        [
-                                "user",
-                                "cash",
-                                10
-                        ]
-                ]
-        },
-        "5": {
-                "Id": 5,
-                "Chapter": 1,
-                "Process": 5,
-                "BossProcess": 10,
-                "EnemyLevel": 1.2,
-                "BossJsonArr": [
-                        [
-                                30,
-                                79,
-                                2,
-                                1,
-                                1,
-                                1,
-                                2.5
-                        ],
-                        [
-                                100,
-                                79,
-                                2,
-                                1,
-                                1,
-                                1,
-                                2.5
-                        ]
-                ],
-                "NewReward": [
-                        [
-                                "user",
-                                "gold",
-                                10
-                        ],
-                        [
-                                "user",
-                                "cash",
-                                10
-                        ]
-                ]
-        },
-        "6": {
-                "Id": 6,
-                "Chapter": 1,
-                "Process": 6,
-                "BossProcess": 10,
-                "EnemyLevel": 1.2,
-                "BossJsonArr": null,
-                "NewReward": [
-                        [
-                                "user",
-                                "gold",
-                                10
-                        ],
-                        [
-                                "user",
-                                "cash",
-                                10
-                        ]
-                ]
-        },
-        "7": {
-                "Id": 7,
-                "Chapter": 1,
-                "Process": 7,
-                "BossProcess": 10,
-                "EnemyLevel": 1.2,
-                "BossJsonArr": null,
-                "NewReward": [
-                        [
-                                "user",
-                                "gold",
-                                10
-                        ],
-                        [
-                                "user",
-                                "cash",
-                                10
-                        ]
-                ]
-        },
-        "8": {
-                "Id": 8,
-                "Chapter": 1,
-                "Process": 8,
-                "BossProcess": 10,
-                "EnemyLevel": 1.2,
-                "BossJsonArr": null,
-                "NewReward": [
-                        [
-                                "user",
-                                "gold",
-                                10
-                        ],
-                        [
-                                "user",
-                                "cash",
-                                10
-                        ]
-                ]
-        },
-        "9": {
-                "Id": 9,
-                "Chapter": 1,
-                "Process": 9,
-                "BossProcess": 10,
-                "EnemyLevel": 1.2,
-                "BossJsonArr": null,
-                "NewReward": [
-                        [
-                                "user",
-                                "gold",
-                                10
-                        ],
-                        [
-                                "user",
-                                "cash",
-                                10
-                        ]
-                ]
-        },
-        "10": {
-                "Id": 10,
-                "Chapter": 1,
-                "Process": 10,
-                "BossProcess": 10,
-                "EnemyLevel": 1.2,
-                "BossJsonArr": [
-                        [
-                                30,
-                                79,
-                                2,
-                                1,
-                                1,
-                                1,
-                                5
-                        ],
-                        [
-                                100,
-                                79,
-                                2,
-                                1,
-                                1,
-                                1,
-                                5
-                        ]
-                ],
-                "NewReward": [
-                        [
-                                "user",
-                                "gold",
-                                10
-                        ],
-                        [
-                                "user",
-                                "cash",
-                                10
-                        ]
-                ]
-        },
-        "11": {
-                "Id": 11,
-                "Chapter": 2,
-                "Process": 1,
-                "BossProcess": 20,
-                "EnemyLevel": 1.2,
-                "BossJsonArr": null,
-                "NewReward": [
-                        [
-                                "user",
-                                "gold",
-                                10
-                        ],
-                        [
-                                "user",
-                                "cash",
-                                10
-                        ]
-                ]
-        },
-        "12": {
-                "Id": 12,
-                "Chapter": 2,
-                "Process": 2,
-                "BossProcess": 20,
-                "EnemyLevel": 1.2,
-                "BossJsonArr": null,
-                "NewReward": [
-                        [
-                                "user",
-                                "gold",
-                                10
-                        ],
-                        [
-                                "user",
-                                "cash",
-                                10
-                        ]
-                ]
-        },
-        "13": {
-                "Id": 13,
-                "Chapter": 2,
-                "Process": 3,
-                "BossProcess": 20,
-                "EnemyLevel": 1.2,
-                "BossJsonArr": null,
-                "NewReward": [
-                        [
-                                "user",
-                                "gold",
-                                10
-                        ],
-                        [
-                                "user",
-                                "cash",
-                                10
-                        ]
-                ]
-        },
-        "14": {
-                "Id": 14,
-                "Chapter": 2,
-                "Process": 4,
-                "BossProcess": 20,
-                "EnemyLevel": 1.2,
-                "BossJsonArr": null,
-                "NewReward": [
-                        [
-                                "user",
-                                "gold",
-                                10
-                        ],
-                        [
-                                "user",
-                                "cash",
-                                10
-                        ]
-                ]
-        },
-        "15": {
-                "Id": 15,
-                "Chapter": 2,
-                "Process": 5,
-                "BossProcess": 20,
-                "EnemyLevel": 1.2,
-                "BossJsonArr": [
-                        [
-                                30,
-                                79,
-                                2,
-                                1,
-                                1,
-                                1,
-                                3
-                        ],
-                        [
-                                100,
-                                79,
-                                2,
-                                1,
-                                1,
-                                1,
-                                3
-                        ]
-                ],
-                "NewReward": [
-                        [
-                                "user",
-                                "gold",
-                                10
-                        ],
-                        [
-                                "user",
-                                "cash",
-                                10
-                        ]
-                ]
-        },
-        "16": {
-                "Id": 16,
-                "Chapter": 2,
-                "Process": 6,
-                "BossProcess": 20,
-                "EnemyLevel": 1.2,
-                "BossJsonArr": null,
-                "NewReward": [
-                        [
-                                "user",
-                                "gold",
-                                10
-                        ],
-                        [
-                                "user",
-                                "cash",
-                                10
-                        ]
-                ]
-        },
-        "17": {
-                "Id": 17,
-                "Chapter": 2,
-                "Process": 7,
-                "BossProcess": 20,
-                "EnemyLevel": 1.2,
-                "BossJsonArr": null,
-                "NewReward": [
-                        [
-                                "user",
-                                "gold",
-                                10
-                        ],
-                        [
-                                "user",
-                                "cash",
-                                10
-                        ]
-                ]
-        },
-        "18": {
-                "Id": 18,
-                "Chapter": 2,
-                "Process": 8,
-                "BossProcess": 20,
-                "EnemyLevel": 1.2,
-                "BossJsonArr": null,
-                "NewReward": [
-                        [
-                                "user",
-                                "gold",
-                                10
-                        ],
-                        [
-                                "user",
-                                "cash",
-                                10
-                        ]
-                ]
-        },
-        "19": {
-                "Id": 19,
-                "Chapter": 2,
-                "Process": 9,
-                "BossProcess": 20,
-                "EnemyLevel": 1.2,
-                "BossJsonArr": null,
-                "NewReward": [
-                        [
-                                "user",
-                                "gold",
-                                10
-                        ],
-                        [
-                                "user",
-                                "cash",
-                                10
-                        ]
-                ]
-        },
-        "20": {
-                "Id": 20,
-                "Chapter": 2,
-                "Process": 10,
-                "BossProcess": 20,
-                "EnemyLevel": 1.2,
-                "BossJsonArr": [
-                        [
-                                30,
-                                79,
-                                2,
-                                1,
-                                1,
-                                1,
-                                5
-                        ],
-                        [
-                                100,
-                                79,
-                                2,
-                                1,
-                                1,
-                                1,
-                                5
-                        ]
-                ],
-                "NewReward": [
-                        [
-                                "user",
-                                "gold",
-                                10
-                        ],
-                        [
-                                "user",
-                                "cash",
-                                10
-                        ]
-                ]
-        }
-    };
-}
+        export const data = {
+            "1": {
+                    "Id": 1,
+                    "Chapter": 1,
+                    "Process": 1,
+                    "BossProcess": 10,
+                    "EnemyLevel": 1,
+                    "BossJsonArr": null,
+                    "NewReward": [
+                            [
+                                    "user",
+                                    "gold",
+                                    10
+                            ],
+                            [
+                                    "user",
+                                    "cash",
+                                    10
+                            ]
+                    ],
+                    "Unlock": 4
+            },
+            "2": {
+                    "Id": 2,
+                    "Chapter": 1,
+                    "Process": 2,
+                    "BossProcess": 10,
+                    "EnemyLevel": 1.2,
+                    "BossJsonArr": null,
+                    "NewReward": [
+                            [
+                                    "user",
+                                    "gold",
+                                    10
+                            ],
+                            [
+                                    "user",
+                                    "cash",
+                                    10
+                            ]
+                    ],
+                    "Unlock": 4
+            },
+            "3": {
+                    "Id": 3,
+                    "Chapter": 1,
+                    "Process": 3,
+                    "BossProcess": 10,
+                    "EnemyLevel": 1.2,
+                    "BossJsonArr": null,
+                    "NewReward": [
+                            [
+                                    "user",
+                                    "gold",
+                                    10
+                            ],
+                            [
+                                    "user",
+                                    "cash",
+                                    10
+                            ]
+                    ],
+                    "Unlock": 4
+            },
+            "4": {
+                    "Id": 4,
+                    "Chapter": 1,
+                    "Process": 4,
+                    "BossProcess": 10,
+                    "EnemyLevel": 1.2,
+                    "BossJsonArr": null,
+                    "NewReward": [
+                            [
+                                    "user",
+                                    "gold",
+                                    10
+                            ],
+                            [
+                                    "user",
+                                    "cash",
+                                    10
+                            ]
+                    ],
+                    "Unlock": 5
+            },
+            "5": {
+                    "Id": 5,
+                    "Chapter": 1,
+                    "Process": 5,
+                    "BossProcess": 10,
+                    "EnemyLevel": 1.2,
+                    "BossJsonArr": [
+                            [
+                                    30,
+                                    79,
+                                    2,
+                                    1,
+                                    1,
+                                    1,
+                                    2.5
+                            ],
+                            [
+                                    100,
+                                    79,
+                                    2,
+                                    1,
+                                    1,
+                                    1,
+                                    2.5
+                            ]
+                    ],
+                    "NewReward": [
+                            [
+                                    "user",
+                                    "gold",
+                                    10
+                            ],
+                            [
+                                    "user",
+                                    "cash",
+                                    10
+                            ]
+                    ],
+                    "Unlock": 6
+            },
+            "6": {
+                    "Id": 6,
+                    "Chapter": 1,
+                    "Process": 6,
+                    "BossProcess": 10,
+                    "EnemyLevel": 1.2,
+                    "BossJsonArr": null,
+                    "NewReward": [
+                            [
+                                    "user",
+                                    "gold",
+                                    10
+                            ],
+                            [
+                                    "user",
+                                    "cash",
+                                    10
+                            ]
+                    ],
+                    "Unlock": 7
+            },
+            "7": {
+                    "Id": 7,
+                    "Chapter": 1,
+                    "Process": 7,
+                    "BossProcess": 10,
+                    "EnemyLevel": 1.2,
+                    "BossJsonArr": null,
+                    "NewReward": [
+                            [
+                                    "user",
+                                    "gold",
+                                    10
+                            ],
+                            [
+                                    "user",
+                                    "cash",
+                                    10
+                            ]
+                    ],
+                    "Unlock": 8
+            },
+            "8": {
+                    "Id": 8,
+                    "Chapter": 1,
+                    "Process": 8,
+                    "BossProcess": 10,
+                    "EnemyLevel": 1.2,
+                    "BossJsonArr": null,
+                    "NewReward": [
+                            [
+                                    "user",
+                                    "gold",
+                                    10
+                            ],
+                            [
+                                    "user",
+                                    "cash",
+                                    10
+                            ]
+                    ],
+                    "Unlock": 9
+            },
+            "9": {
+                    "Id": 9,
+                    "Chapter": 1,
+                    "Process": 9,
+                    "BossProcess": 10,
+                    "EnemyLevel": 1.2,
+                    "BossJsonArr": null,
+                    "NewReward": [
+                            [
+                                    "user",
+                                    "gold",
+                                    10
+                            ],
+                            [
+                                    "user",
+                                    "cash",
+                                    10
+                            ]
+                    ],
+                    "Unlock": 10
+            },
+            "10": {
+                    "Id": 10,
+                    "Chapter": 1,
+                    "Process": 10,
+                    "BossProcess": 10,
+                    "EnemyLevel": 1.2,
+                    "BossJsonArr": [
+                            [
+                                    30,
+                                    79,
+                                    2,
+                                    1,
+                                    1,
+                                    1,
+                                    5
+                            ],
+                            [
+                                    100,
+                                    79,
+                                    2,
+                                    1,
+                                    1,
+                                    1,
+                                    5
+                            ]
+                    ],
+                    "NewReward": [
+                            [
+                                    "user",
+                                    "gold",
+                                    10
+                            ],
+                            [
+                                    "user",
+                                    "cash",
+                                    10
+                            ]
+                    ],
+                    "Unlock": 11
+            },
+            "11": {
+                    "Id": 11,
+                    "Chapter": 2,
+                    "Process": 1,
+                    "BossProcess": 20,
+                    "EnemyLevel": 1.2,
+                    "BossJsonArr": null,
+                    "NewReward": [
+                            [
+                                    "user",
+                                    "gold",
+                                    10
+                            ],
+                            [
+                                    "user",
+                                    "cash",
+                                    10
+                            ]
+                    ],
+                    "Unlock": 12
+            },
+            "12": {
+                    "Id": 12,
+                    "Chapter": 2,
+                    "Process": 2,
+                    "BossProcess": 20,
+                    "EnemyLevel": 1.2,
+                    "BossJsonArr": null,
+                    "NewReward": [
+                            [
+                                    "user",
+                                    "gold",
+                                    10
+                            ],
+                            [
+                                    "user",
+                                    "cash",
+                                    10
+                            ]
+                    ],
+                    "Unlock": 13
+            },
+            "13": {
+                    "Id": 13,
+                    "Chapter": 2,
+                    "Process": 3,
+                    "BossProcess": 20,
+                    "EnemyLevel": 1.2,
+                    "BossJsonArr": null,
+                    "NewReward": [
+                            [
+                                    "user",
+                                    "gold",
+                                    10
+                            ],
+                            [
+                                    "user",
+                                    "cash",
+                                    10
+                            ]
+                    ],
+                    "Unlock": 14
+            },
+            "14": {
+                    "Id": 14,
+                    "Chapter": 2,
+                    "Process": 4,
+                    "BossProcess": 20,
+                    "EnemyLevel": 1.2,
+                    "BossJsonArr": null,
+                    "NewReward": [
+                            [
+                                    "user",
+                                    "gold",
+                                    10
+                            ],
+                            [
+                                    "user",
+                                    "cash",
+                                    10
+                            ]
+                    ],
+                    "Unlock": 15
+            },
+            "15": {
+                    "Id": 15,
+                    "Chapter": 2,
+                    "Process": 5,
+                    "BossProcess": 20,
+                    "EnemyLevel": 1.2,
+                    "BossJsonArr": [
+                            [
+                                    30,
+                                    79,
+                                    2,
+                                    1,
+                                    1,
+                                    1,
+                                    3
+                            ],
+                            [
+                                    100,
+                                    79,
+                                    2,
+                                    1,
+                                    1,
+                                    1,
+                                    3
+                            ]
+                    ],
+                    "NewReward": [
+                            [
+                                    "user",
+                                    "gold",
+                                    10
+                            ],
+                            [
+                                    "user",
+                                    "cash",
+                                    10
+                            ]
+                    ],
+                    "Unlock": 16
+            },
+            "16": {
+                    "Id": 16,
+                    "Chapter": 2,
+                    "Process": 6,
+                    "BossProcess": 20,
+                    "EnemyLevel": 1.2,
+                    "BossJsonArr": null,
+                    "NewReward": [
+                            [
+                                    "user",
+                                    "gold",
+                                    10
+                            ],
+                            [
+                                    "user",
+                                    "cash",
+                                    10
+                            ]
+                    ],
+                    "Unlock": 17
+            },
+            "17": {
+                    "Id": 17,
+                    "Chapter": 2,
+                    "Process": 7,
+                    "BossProcess": 20,
+                    "EnemyLevel": 1.2,
+                    "BossJsonArr": null,
+                    "NewReward": [
+                            [
+                                    "user",
+                                    "gold",
+                                    10
+                            ],
+                            [
+                                    "user",
+                                    "cash",
+                                    10
+                            ]
+                    ],
+                    "Unlock": 18
+            },
+            "18": {
+                    "Id": 18,
+                    "Chapter": 2,
+                    "Process": 8,
+                    "BossProcess": 20,
+                    "EnemyLevel": 1.2,
+                    "BossJsonArr": null,
+                    "NewReward": [
+                            [
+                                    "user",
+                                    "gold",
+                                    10
+                            ],
+                            [
+                                    "user",
+                                    "cash",
+                                    10
+                            ]
+                    ],
+                    "Unlock": 19
+            },
+            "19": {
+                    "Id": 19,
+                    "Chapter": 2,
+                    "Process": 9,
+                    "BossProcess": 20,
+                    "EnemyLevel": 1.2,
+                    "BossJsonArr": null,
+                    "NewReward": [
+                            [
+                                    "user",
+                                    "gold",
+                                    10
+                            ],
+                            [
+                                    "user",
+                                    "cash",
+                                    10
+                            ]
+                    ],
+                    "Unlock": 20
+            },
+            "20": {
+                    "Id": 20,
+                    "Chapter": 2,
+                    "Process": 10,
+                    "BossProcess": 20,
+                    "EnemyLevel": 1.2,
+                    "BossJsonArr": [
+                            [
+                                    30,
+                                    79,
+                                    2,
+                                    1,
+                                    1,
+                                    1,
+                                    5
+                            ],
+                            [
+                                    100,
+                                    79,
+                                    2,
+                                    1,
+                                    1,
+                                    1,
+                                    5
+                            ]
+                    ],
+                    "NewReward": [
+                            [
+                                    "user",
+                                    "gold",
+                                    10
+                            ],
+                            [
+                                    "user",
+                                    "cash",
+                                    10
+                            ]
+                    ],
+                    "Unlock": 21
+            }
+        };
+    }

+ 0 - 58
assets/script/game/ui/tower/conf/HeroConf.ts

@@ -1,58 +0,0 @@
-export namespace HeroConf {
-    export const data = {
-        "1": {
-                "Id": 1,
-                "Speed": 20,
-                "Damage": 1,
-                "Critical": 0.1,
-                "CriticalDamage": 1.4,
-                "Radius": 2.5,
-                "AttackType": 1,
-                "AttackTypeRadius": 0.8,
-                "SkillArray": [
-                        1,
-                        3
-                ],
-                "ModelName": "npc001"
-        },
-        "2": {
-                "Id": 2,
-                "Speed": 4,
-                "Damage": 1,
-                "Critical": 0.1,
-                "CriticalDamage": 1.4,
-                "Radius": 2.5,
-                "AttackType": 1,
-                "AttackTypeRadius": 0,
-                "SkillArray": [],
-                "ModelName": "npc002"
-        },
-        "3": {
-                "Id": 3,
-                "Speed": 12,
-                "Damage": 1,
-                "Critical": 0.1,
-                "CriticalDamage": 1.4,
-                "Radius": 9,
-                "AttackType": 1,
-                "AttackTypeRadius": 0.8,
-                "SkillArray": [
-                        1,
-                        3
-                ],
-                "ModelName": "npc001"
-        },
-        "4": {
-                "Id": 3,
-                "Speed": 4,
-                "Damage": 1,
-                "Critical": 0.1,
-                "CriticalDamage": 1.4,
-                "Radius": 9,
-                "AttackType": 1,
-                "AttackTypeRadius": 0,
-                "SkillArray": [],
-                "ModelName": "npc002"
-        },
-    };
-}

+ 2 - 2
assets/script/game/ui/tower/conf/MapConf.ts

@@ -71,7 +71,7 @@ export namespace MapConf {
                                     79,
                                     1,
                                     1,
-                                    10,
+                                    1,
                                     5
                             ],
                             [
@@ -79,7 +79,7 @@ export namespace MapConf {
                                     79,
                                     1,
                                     1,
-                                    10,
+                                    1,
                                     5
                             ]
                     ],

+ 2 - 43
assets/script/game/ui/tower/control/BattleControl.ts

@@ -170,54 +170,13 @@ export class BattleControl extends BattleBase{
                         }
                         break;
                     }
-                // case ObjectValueType.Attack:{
-                //         // let startPosID = heroDataChange.changeValueLlist[0] 
-                //         // let startPos = this.map.attackPosDataMap1.get(startPosID)
-                //         // if(startPos && startPos.hero){
-                //         //     startPos.hero.attackDamage = heroDataChange.changeValueLlist[1]
-                //         // }
-                //         break;
-                //     }
-                // case ObjectValueType.AttackRadius:{
-                //     let startPosID = heroDataChange.changeValueLlist[0] 
-                //     let startPos = this.map.attackPosDataMap1[startPosID]
-                //     if(startPos && startPos.hero){
-                //         startPos.hero.attackRadius = heroDataChange.changeValueLlist[1]
-                //     }
-                //     break;
-                // }
-                // case ObjectValueType.Speed:{
-                //     let startPosID = heroDataChange.changeValueLlist[0] 
-                //     let startPos = this.map.attackPosDataMap1[startPosID]
-                //     if(startPos && startPos.hero){
-                //         startPos.hero.speed = heroDataChange.changeValueLlist[1]
-                //     }
-                //     break;
-                // }
-                // case ObjectValueType.Critical:{
-                //     let startPosID = heroDataChange.changeValueLlist[0] 
-                //     let startPos = this.map.attackPosDataMap1[startPosID]
-                //     if(startPos && startPos.hero){
-                //         startPos.hero.critical = heroDataChange.changeValueLlist[1]
-                //     }
-                //     break;
-                // }
-                // case ObjectValueType.CriticalDamage:{
-                //     let startPosID = heroDataChange.changeValueLlist[0] 
-                //     let startPos = this.map.attackPosDataMap1[startPosID]
-                //     if(startPos && startPos.hero){
-                //         startPos.hero.criticalDamage = heroDataChange.changeValueLlist[1]
-                //     }
-                //     break;
-                // }
+                
             }
            
         }
     }
 
-    //更新子弹
-    // private updateBullet(){
-    // }
+
     //更新buff计时
     private updateBuff(){
         this.buffControl.update()

+ 1 - 1
assets/script/game/ui/tower/control/BuffControl.ts

@@ -1,6 +1,6 @@
 import { BattleBase } from "../base/BattleBase";
 import { BattleEventManager } from "../base/BattleEventManager";
-import { BattleEventData_EnemyBuff, BattleEventData_EnemyDie, BattleEventData_EnemyHurt, BattleEventData_EnemyMove, BattleEventTarget, BattleEventType, BuffEventState, HurtEventState } from "../base/BattleEventUtil";
+import { BattleEventData_EnemyBuff,  BattleEventData_EnemyHurt, BattleEventData_EnemyMove, BattleEventTarget, BattleEventType, BuffEventState, HurtEventState } from "../base/BattleEventUtil";
 import { BuffType } from "../data/BattleEnum";
 import { BattleUtil } from "../data/BattleUtil";
 import { BuffData ,BuffDataPool} from "../data/BuffData";

+ 1 - 0
assets/script/game/ui/tower/control/EnemyControl.ts

@@ -35,6 +35,7 @@ export class EnemyControl extends BattleBase{
             if(enemy.life <= 0){
                 let eventData:BattleEventData_EnemyDie = {
                     eventType: BattleEventType.EnemyDie,
+                    typeID: enemy.typeID,
                     ID: enemy.ID
                 }
                 this.battleEventManager.fireEvent(BattleEventTarget.Update,eventData)

+ 2 - 1
assets/script/game/ui/tower/data/BattleUtil.ts

@@ -2,7 +2,8 @@ import { ObjectValueType } from "./BattleEnum";
 
 export namespace BattleUtil {
     //背包容量
-    export const BagListSize = 10;
+    export const BagListSize = 15;
+    export const AttackListSize = 10;
     //战斗辅助工具类
     export const FrameRate = 30; //帧率
     export const FrameTime = 1 / FrameRate; //帧间隔

+ 13 - 3
assets/script/game/ui/tower/data/HeroData.ts

@@ -1,4 +1,5 @@
-import { HeroConf } from "../conf/HeroConf";
+
+import { RoleConf } from "../conf/RoleConf";
 import { UptypeConf } from "../conf/UptypeConf";
 import { BattleDataPool } from "./BattleDataPool";
 import { BulletType, ObjectValueType } from "./BattleEnum";
@@ -8,6 +9,8 @@ import { DataBase } from "./DataBase";
 import { EnemyData } from "./EnemyData";
 import { SkillData, SkillDataPool } from "./SkillData";
 
+//种族缩放因子
+export let HeroRaceSacle = 100;
 
 export class HeroData extends DataBase{
     level: number;
@@ -46,6 +49,9 @@ export class HeroData extends DataBase{
     protected _criticalCur: number;
     //暴击伤害
     protected _criticalDamageCur: number;
+
+    //种族
+    protected _raceID: number;
     
     //特殊攻击
     // spaceValueList:Map<ObjectValueType,BattleUtil.SpecialValue[]> = new Map();
@@ -72,10 +78,10 @@ export class HeroData extends DataBase{
         this.level = level;
         this.typeID = typeID;
         this.posID = posID;
-
+        this._raceID = (typeID - typeID%HeroRaceSacle)/HeroRaceSacle
         //读地图
         this.position = new BattleUtil.Vector2(0, 0);
-        let heroConf = HeroConf.data[typeID]
+        let heroConf = RoleConf.data[typeID]
         if (heroConf) {
             this.attackType = heroConf.AttackType;
             this._speed = heroConf.Speed;
@@ -141,6 +147,10 @@ export class HeroData extends DataBase{
     get criticalDamage(): number{
         return this._criticalDamageCur;
     }
+
+    get raceID(): number{
+        return this._raceID;
+    }
     //只对buff进行记录
     addBuff(buff:BuffData) {
         this.buffList.push(buff);

+ 16 - 9
assets/script/game/ui/tower/node/Hero.ts

@@ -5,7 +5,6 @@ import { HeroData } from '../data/HeroData';
 import { AudioID } from '../../../../framework/config/AudioConf';
 import { Framework } from '../../../../framework/Framework';
 import { UptypeConf } from '../conf/UptypeConf';
-import { HeroConf } from '../conf/HeroConf';
 import { BattleEventManager } from '../base/BattleEventManager';
 import { BattleEventHeroAction, BattleEventTarget, HeroActionType } from '../base/BattleEventUtil';
 import { BattleUtil } from '../data/BattleUtil';
@@ -30,7 +29,7 @@ export class Hero extends BattleNodeBase {
     clickBox: UITransform = null;
 
     //所属格子 -1表示暂无
-    private _posID = -1;
+    private _posIndex = -1;
 
   
     private _bAttackAnimation: boolean = false;
@@ -49,6 +48,9 @@ export class Hero extends BattleNodeBase {
 
     attackSlot = null;
     typeID: number = -1; 
+    private _raceID: number = -1;
+
+
     level: number = 1; 
     radius = 1; //半径
 
@@ -57,11 +59,15 @@ export class Hero extends BattleNodeBase {
     battleEventManager: BattleEventManager;
 
 
-    set posID(posID:number){
-        this._posID = posID;
+    set posIndex(posIndx:number){
+        this._posIndex = posIndx;
     }
-    get posID(){
-        return this._posID;
+    get posIndex(){
+        return this._posIndex;
+    }
+
+    get raceID(){
+        return this._raceID;
     }
 
     protected onLoad(): void {
@@ -112,6 +118,7 @@ export class Hero extends BattleNodeBase {
 
     resetData(heroData:HeroData) {
         this.typeID = heroData.typeID;
+        this._raceID = heroData.raceID;
         this.level = heroData.level;
         this.radius = heroData.attackRadius;
         this.levelLabel.string = heroData.level.toString();
@@ -129,7 +136,7 @@ export class Hero extends BattleNodeBase {
     clearData() {
         this.node.active = false;
         this.modelSpine.node.active = false;
-        this._posID = -1;
+        this._posIndex = -1;
         this.typeID = -1;
         this.level = 0;
         this._isLock = false;
@@ -257,10 +264,10 @@ export class Hero extends BattleNodeBase {
             //     this._attackCallback(trackEntry);
             // }
             // console.log("攻击动作完成:",trackEntry.animation.name)
-            if(this.posID > BattleUtil.PosID_Init){
+            if(this.posIndex > BattleUtil.PosID_Init){
                 let eventData:BattleEventHeroAction = {
                     action: HeroActionType.Normal,
-                    posIndex: this._posID - BattleUtil.BagListSize
+                    posIndex: this._posIndex - BattleUtil.BagListSize
                 }
                 this.battleEventManager.fireEvent(BattleEventTarget.HeroAction,eventData)
             }

部分文件因为文件数量过多而无法显示