Parcourir la source

子弹图片美术

181404010226 il y a 6 mois
Parent
commit
7a913e408c

+ 54 - 616
assets/Scenes/TestScene.scene

@@ -23,7 +23,7 @@
     "_active": true,
     "_components": [],
     "_prefab": {
-      "__id__": 36
+      "__id__": 21
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -54,7 +54,7 @@
     },
     "autoReleaseAssets": false,
     "_globals": {
-      "__id__": 37
+      "__id__": 22
     },
     "_id": "8a125a67-dbc5-4c64-b398-6a616deee4aa"
   },
@@ -71,22 +71,19 @@
         "__id__": 3
       },
       {
-        "__id__": 11
-      },
-      {
-        "__id__": 31
+        "__id__": 16
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 33
+        "__id__": 18
       },
       {
-        "__id__": 34
+        "__id__": 19
       },
       {
-        "__id__": 35
+        "__id__": 20
       }
     ],
     "_prefab": null,
@@ -135,16 +132,19 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 27
+        "__id__": 11
       },
       {
-        "__id__": 28
+        "__id__": 12
       },
       {
-        "__id__": 29
+        "__id__": 13
       },
       {
-        "__id__": 30
+        "__id__": 14
+      },
+      {
+        "__id__": 15
       }
     ],
     "_prefab": null,
@@ -175,7 +175,7 @@
       "y": 0,
       "z": 0
     },
-    "_id": "0faX8MIO1FqpP7Oy0AP7mJ"
+    "_id": "79zHrTWPJP87Q/Ow+2pmvl"
   },
   {
     "__type__": "cc.Node",
@@ -196,7 +196,7 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 26
+        "__id__": 10
       }
     ],
     "_prefab": null,
@@ -227,7 +227,7 @@
       "y": 0,
       "z": 0
     },
-    "_id": "4eFl0NHzpF17HZamR5AN8N"
+    "_id": "59H3YpHHJIsrmeBtM9e5Qz"
   },
   {
     "__type__": "cc.Node",
@@ -272,7 +272,7 @@
       "y": 0,
       "z": 0
     },
-    "_id": "9d7DuyLyJKJKSE3i5zi5ti"
+    "_id": "95fu6qpq1C5LaqrUrB/HHO"
   },
   {
     "__type__": "cc.UITransform",
@@ -294,7 +294,7 @@
       "x": 0.5,
       "y": 0.5
     },
-    "_id": "27K+UJgpVFX54Zya3WPGHc"
+    "_id": "13JoufCTVCF7q/oxsrGdmn"
   },
   {
     "__type__": "cc.Node",
@@ -312,9 +312,6 @@
       },
       {
         "__id__": 9
-      },
-      {
-        "__id__": 10
       }
     ],
     "_prefab": null,
@@ -345,7 +342,7 @@
       "y": 0,
       "z": 0
     },
-    "_id": "b0N6sWKrBMRKeNRMZQDX0v"
+    "_id": "eevVLyCRRKkpEMJFXBVYNA"
   },
   {
     "__type__": "cc.UITransform",
@@ -367,7 +364,7 @@
       "x": 0.5,
       "y": 0.5
     },
-    "_id": "39vTzmLi5Ae6IRu3ny8gFR"
+    "_id": "dfB97US6RMM73LJ+s64fT7"
   },
   {
     "__type__": "cc.Sprite",
@@ -406,583 +403,7 @@
     "_isTrimmedMode": true,
     "_useGrayscale": false,
     "_atlas": null,
-    "_id": "6a1JrBPgVBCJH7QC807z/s"
-  },
-  {
-    "__type__": "1325eBeZRVH5KbFuC2JSfeY",
-    "_name": "",
-    "_objFlags": 0,
-    "__editorExtras__": {},
-    "node": {
-      "__id__": 7
-    },
-    "_enabled": true,
-    "__prefab": null,
-    "bulletPrefab": {
-      "__uuid__": "54638943-4461-43b1-b351-a0380e1f30ce",
-      "__expectedType__": "cc.Prefab"
-    },
-    "fireInterval": 0.5,
-    "bulletSpeed": 800,
-    "rotateSpeed": 0.5,
-    "enemyNode": {
-      "__id__": 11
-    },
-    "_id": "b2cAE1d2VPtqVwzqVyYy7a"
-  },
-  {
-    "__type__": "cc.Node",
-    "_name": "Enemy",
-    "_objFlags": 0,
-    "__editorExtras__": {},
-    "_parent": {
-      "__id__": 2
-    },
-    "_children": [
-      {
-        "__id__": 12
-      },
-      {
-        "__id__": 19
-      }
-    ],
-    "_active": true,
-    "_components": [
-      {
-        "__id__": 22
-      },
-      {
-        "__id__": 23
-      },
-      {
-        "__id__": 24
-      },
-      {
-        "__id__": 25
-      }
-    ],
-    "_prefab": null,
-    "_lpos": {
-      "__type__": "cc.Vec3",
-      "x": 203.756,
-      "y": -352.377,
-      "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": "12eW5Uk8pIaaXDbgFA9yuE"
-  },
-  {
-    "__type__": "cc.Node",
-    "_name": "HPBar",
-    "_objFlags": 0,
-    "__editorExtras__": {},
-    "_parent": {
-      "__id__": 11
-    },
-    "_children": [
-      {
-        "__id__": 13
-      }
-    ],
-    "_active": true,
-    "_components": [
-      {
-        "__id__": 16
-      },
-      {
-        "__id__": 17
-      },
-      {
-        "__id__": 18
-      }
-    ],
-    "_prefab": null,
-    "_lpos": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 72.766,
-      "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": "e6WhYYne1CnquozDT1wZwt"
-  },
-  {
-    "__type__": "cc.Node",
-    "_name": "HPForeground",
-    "_objFlags": 0,
-    "__editorExtras__": {},
-    "_parent": {
-      "__id__": 12
-    },
-    "_children": [],
-    "_active": true,
-    "_components": [
-      {
-        "__id__": 14
-      },
-      {
-        "__id__": 15
-      }
-    ],
-    "_prefab": null,
-    "_lpos": {
-      "__type__": "cc.Vec3",
-      "x": -24.351,
-      "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": "524WNceIpG4KG1zS5kuhKo"
-  },
-  {
-    "__type__": "cc.UITransform",
-    "_name": "",
-    "_objFlags": 0,
-    "__editorExtras__": {},
-    "node": {
-      "__id__": 13
-    },
-    "_enabled": true,
-    "__prefab": null,
-    "_contentSize": {
-      "__type__": "cc.Size",
-      "width": 20.400000000000002,
-      "height": 10
-    },
-    "_anchorPoint": {
-      "__type__": "cc.Vec2",
-      "x": 0,
-      "y": 0.5
-    },
-    "_id": "a9DfV2nWVE5qjlqrTeOgtA"
-  },
-  {
-    "__type__": "cc.Sprite",
-    "_name": "",
-    "_objFlags": 0,
-    "__editorExtras__": {},
-    "node": {
-      "__id__": 13
-    },
-    "_enabled": true,
-    "__prefab": null,
-    "_customMaterial": null,
-    "_srcBlendFactor": 2,
-    "_dstBlendFactor": 4,
-    "_color": {
-      "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
-      "a": 255
-    },
-    "_spriteFrame": {
-      "__uuid__": "f5b3c771-0b73-4b9e-a778-932e7ee9d8fa@f9941",
-      "__expectedType__": "cc.SpriteFrame"
-    },
-    "_type": 0,
-    "_fillType": 0,
-    "_sizeMode": 0,
-    "_fillCenter": {
-      "__type__": "cc.Vec2",
-      "x": 0,
-      "y": 0
-    },
-    "_fillStart": 0,
-    "_fillRange": 0,
-    "_isTrimmedMode": true,
-    "_useGrayscale": false,
-    "_atlas": null,
-    "_id": "07oUBETBdMirjFXWC8Wdpm"
-  },
-  {
-    "__type__": "cc.UITransform",
-    "_name": "",
-    "_objFlags": 0,
-    "__editorExtras__": {},
-    "node": {
-      "__id__": 12
-    },
-    "_enabled": true,
-    "__prefab": null,
-    "_contentSize": {
-      "__type__": "cc.Size",
-      "width": 51,
-      "height": 13
-    },
-    "_anchorPoint": {
-      "__type__": "cc.Vec2",
-      "x": 0.5,
-      "y": 0.5
-    },
-    "_id": "38bIsp3/FG6bNIglkCSedQ"
-  },
-  {
-    "__type__": "cc.Sprite",
-    "_name": "",
-    "_objFlags": 0,
-    "__editorExtras__": {},
-    "node": {
-      "__id__": 12
-    },
-    "_enabled": true,
-    "__prefab": null,
-    "_customMaterial": null,
-    "_srcBlendFactor": 2,
-    "_dstBlendFactor": 4,
-    "_color": {
-      "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
-      "a": 255
-    },
-    "_spriteFrame": {
-      "__uuid__": "45bd99da-8893-435b-8110-5da90043375b@f9941",
-      "__expectedType__": "cc.SpriteFrame"
-    },
-    "_type": 0,
-    "_fillType": 0,
-    "_sizeMode": 1,
-    "_fillCenter": {
-      "__type__": "cc.Vec2",
-      "x": 0,
-      "y": 0
-    },
-    "_fillStart": 0,
-    "_fillRange": 0,
-    "_isTrimmedMode": true,
-    "_useGrayscale": false,
-    "_atlas": null,
-    "_id": "b7wduIz2hCMIuEPmei2k07"
-  },
-  {
-    "__type__": "cc.ProgressBar",
-    "_name": "",
-    "_objFlags": 0,
-    "__editorExtras__": {},
-    "node": {
-      "__id__": 12
-    },
-    "_enabled": true,
-    "__prefab": null,
-    "_barSprite": {
-      "__id__": 15
-    },
-    "_mode": 0,
-    "_totalLength": 51,
-    "_progress": 0.4,
-    "_reverse": false,
-    "_id": "70/jd+AJpAzKBzSFLtQzPo"
-  },
-  {
-    "__type__": "cc.Node",
-    "_name": "HPLabel",
-    "_objFlags": 0,
-    "__editorExtras__": {},
-    "_parent": {
-      "__id__": 11
-    },
-    "_children": [],
-    "_active": true,
-    "_components": [
-      {
-        "__id__": 20
-      },
-      {
-        "__id__": 21
-      }
-    ],
-    "_prefab": null,
-    "_lpos": {
-      "__type__": "cc.Vec3",
-      "x": 0,
-      "y": 92.224,
-      "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": "705gZUETpOYqHi2Gr+zJu2"
-  },
-  {
-    "__type__": "cc.UITransform",
-    "_name": "",
-    "_objFlags": 0,
-    "__editorExtras__": {},
-    "node": {
-      "__id__": 19
-    },
-    "_enabled": true,
-    "__prefab": null,
-    "_contentSize": {
-      "__type__": "cc.Size",
-      "width": 26.24609375,
-      "height": 54.4
-    },
-    "_anchorPoint": {
-      "__type__": "cc.Vec2",
-      "x": 0.5,
-      "y": 0.5
-    },
-    "_id": "31bkRuWV5Of45avhpMFTsh"
-  },
-  {
-    "__type__": "cc.Label",
-    "_name": "",
-    "_objFlags": 0,
-    "__editorExtras__": {},
-    "node": {
-      "__id__": 19
-    },
-    "_enabled": true,
-    "__prefab": null,
-    "_customMaterial": null,
-    "_srcBlendFactor": 2,
-    "_dstBlendFactor": 4,
-    "_color": {
-      "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
-      "a": 255
-    },
-    "_string": "12",
-    "_horizontalAlign": 1,
-    "_verticalAlign": 1,
-    "_actualFontSize": 20,
-    "_fontSize": 20,
-    "_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": true,
-    "_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": "c82UXmQP5LK4ZOHNqqP9yn"
-  },
-  {
-    "__type__": "cc.UITransform",
-    "_name": "",
-    "_objFlags": 0,
-    "__editorExtras__": {},
-    "node": {
-      "__id__": 11
-    },
-    "_enabled": true,
-    "__prefab": null,
-    "_contentSize": {
-      "__type__": "cc.Size",
-      "width": 77.5,
-      "height": 80.5
-    },
-    "_anchorPoint": {
-      "__type__": "cc.Vec2",
-      "x": 0.3161290322580645,
-      "y": 0.09316770186335403
-    },
-    "_id": "a1uLL5v99Oh7UMkCAPpQ3i"
-  },
-  {
-    "__type__": "sp.Skeleton",
-    "_name": "",
-    "_objFlags": 0,
-    "__editorExtras__": {},
-    "node": {
-      "__id__": 11
-    },
-    "_enabled": true,
-    "__prefab": null,
-    "_customMaterial": null,
-    "_srcBlendFactor": 2,
-    "_dstBlendFactor": 4,
-    "_color": {
-      "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
-      "a": 255
-    },
-    "_skeletonData": {
-      "__uuid__": "32ed47c3-b2bb-4d1b-86d7-4395f374c04b",
-      "__expectedType__": "sp.SkeletonData"
-    },
-    "defaultSkin": "default",
-    "defaultAnimation": "<None>",
-    "_premultipliedAlpha": true,
-    "_timeScale": 1,
-    "_preCacheMode": 0,
-    "_cacheMode": 0,
-    "_sockets": [],
-    "_useTint": false,
-    "_debugMesh": false,
-    "_debugBones": false,
-    "_debugSlots": false,
-    "_enableBatch": false,
-    "loop": true,
-    "_id": "49xzZeTTlAwpRaBYgSAIEa"
-  },
-  {
-    "__type__": "cc.BoxCollider2D",
-    "_name": "",
-    "_objFlags": 0,
-    "__editorExtras__": {},
-    "node": {
-      "__id__": 11
-    },
-    "_enabled": true,
-    "__prefab": null,
-    "tag": 4,
-    "_group": 16,
-    "_density": 1,
-    "_sensor": true,
-    "_friction": 0.2,
-    "_restitution": 0,
-    "_offset": {
-      "__type__": "cc.Vec2",
-      "x": 14.250000000000002,
-      "y": 32.75
-    },
-    "_size": {
-      "__type__": "cc.Size",
-      "width": 77.5,
-      "height": 80.5
-    },
-    "_id": "811OconZpIL74P+Cs87pLu"
-  },
-  {
-    "__type__": "cc.RigidBody2D",
-    "_name": "",
-    "_objFlags": 0,
-    "__editorExtras__": {},
-    "node": {
-      "__id__": 11
-    },
-    "_enabled": true,
-    "__prefab": null,
-    "enabledContactListener": false,
-    "bullet": false,
-    "awakeOnLoad": true,
-    "_group": 16,
-    "_type": 1,
-    "_allowSleep": true,
-    "_gravityScale": 1,
-    "_linearDamping": 0,
-    "_angularDamping": 0,
-    "_linearVelocity": {
-      "__type__": "cc.Vec2",
-      "x": 0,
-      "y": 0
-    },
-    "_angularVelocity": 0,
-    "_fixedRotation": false,
-    "_id": "e5SEKMJENL4bQb3aos/R46"
+    "_id": "b1fVbwMr1Df7jr+Dc3hoTy"
   },
   {
     "__type__": "cc.UITransform",
@@ -1004,7 +425,7 @@
       "x": 0.5,
       "y": 0.5
     },
-    "_id": "b3WhZ6389Klo91qBSNxWFx"
+    "_id": "1dXPxqWrpE9LMg0QR64CNt"
   },
   {
     "__type__": "cc.UITransform",
@@ -1026,7 +447,7 @@
       "x": 0.5,
       "y": 0.5
     },
-    "_id": "fa4wQofdxAH6YAPALrhiPW"
+    "_id": "21f8ef/q1BxoI/vee/Yp/Q"
   },
   {
     "__type__": "cc.Sprite",
@@ -1065,7 +486,7 @@
     "_isTrimmedMode": true,
     "_useGrayscale": false,
     "_atlas": null,
-    "_id": "9apGyi8QhMaZ2EyWWsyJYh"
+    "_id": "f2l1F+oVtLooQ6Fzqg+7tc"
   },
   {
     "__type__": "cc.PolygonCollider2D",
@@ -1130,7 +551,7 @@
         "y": 52
       }
     ],
-    "_id": "31LfrouANGMaF6CjJ+Jd79"
+    "_id": "28tKT0+LZMHYqZoUwfuSrz"
   },
   {
     "__type__": "cc.RigidBody2D",
@@ -1158,7 +579,24 @@
     },
     "_angularVelocity": 0,
     "_fixedRotation": false,
-    "_id": "d9JnG4ystDy5dVa5AkCANL"
+    "_id": "abKWZnmoZIfJ3EmOj9pydS"
+  },
+  {
+    "__type__": "e2fb10lUiVLvaLrttZW1KXR",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 3
+    },
+    "_enabled": true,
+    "__prefab": null,
+    "pelletPrefab": {
+      "__uuid__": "54638943-4461-43b1-b351-a0380e1f30ce",
+      "__expectedType__": "cc.Prefab"
+    },
+    "fireInterval": 1,
+    "_id": "c1NzDNJvNJyK+IfeaT48Of"
   },
   {
     "__type__": "cc.Node",
@@ -1172,7 +610,7 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 32
+        "__id__": 17
       }
     ],
     "_prefab": null,
@@ -1211,7 +649,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 31
+      "__id__": 16
     },
     "_enabled": true,
     "__prefab": null,
@@ -1284,7 +722,7 @@
     "_enabled": true,
     "__prefab": null,
     "_cameraComponent": {
-      "__id__": 32
+      "__id__": 17
     },
     "_alignCanvasWithScreen": true,
     "_id": "12O/ljcVlEqLmVm3U2gEOQ"
@@ -1330,28 +768,28 @@
   {
     "__type__": "cc.SceneGlobals",
     "ambient": {
-      "__id__": 38
+      "__id__": 23
     },
     "shadows": {
-      "__id__": 39
+      "__id__": 24
     },
     "_skybox": {
-      "__id__": 40
+      "__id__": 25
     },
     "fog": {
-      "__id__": 41
+      "__id__": 26
     },
     "octree": {
-      "__id__": 42
+      "__id__": 27
     },
     "skin": {
-      "__id__": 43
+      "__id__": 28
     },
     "lightProbeInfo": {
-      "__id__": 44
+      "__id__": 29
     },
     "postSettings": {
-      "__id__": 45
+      "__id__": 30
     },
     "bakedWithStationaryMainLight": false,
     "bakedWithHighpLightmap": false

+ 4 - 7
assets/assets/Prefabs/Pellet.prefab

@@ -110,15 +110,12 @@
     "_dstBlendFactor": 4,
     "_color": {
       "__type__": "cc.Color",
-      "r": 243,
-      "g": 0,
-      "b": 0,
+      "r": 255,
+      "g": 255,
+      "b": 255,
       "a": 255
     },
-    "_spriteFrame": {
-      "__uuid__": "3126e414-a5e1-4681-abf1-59121b6a3723@f9941",
-      "__expectedType__": "cc.SpriteFrame"
-    },
+    "_spriteFrame": null,
     "_type": 0,
     "_fillType": 0,
     "_sizeMode": 1,

+ 34 - 36
assets/assets/Prefabs/WeaponBlock.prefab

@@ -24,6 +24,9 @@
     ],
     "_active": true,
     "_components": [
+      {
+        "__id__": 16
+      },
       {
         "__id__": 18
       },
@@ -88,11 +91,11 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 15
+        "__id__": 13
       }
     ],
     "_prefab": {
-      "__id__": 17
+      "__id__": 15
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -227,13 +230,10 @@
       },
       {
         "__id__": 10
-      },
-      {
-        "__id__": 12
       }
     ],
     "_prefab": {
-      "__id__": 14
+      "__id__": 12
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -337,31 +337,6 @@
     "__type__": "cc.CompPrefabInfo",
     "fileId": "8cVih+ArJFb5TbjLHK7rfX"
   },
-  {
-    "__type__": "1325eBeZRVH5KbFuC2JSfeY",
-    "_name": "",
-    "_objFlags": 0,
-    "__editorExtras__": {},
-    "node": {
-      "__id__": 7
-    },
-    "_enabled": true,
-    "__prefab": {
-      "__id__": 13
-    },
-    "bulletPrefab": {
-      "__uuid__": "54638943-4461-43b1-b351-a0380e1f30ce",
-      "__expectedType__": "cc.Prefab"
-    },
-    "fireInterval": 0.5,
-    "bulletSpeed": 800,
-    "rotateSpeed": 0.5,
-    "_id": ""
-  },
-  {
-    "__type__": "cc.CompPrefabInfo",
-    "fileId": "d1XitZJDhCxodHoe0dv//w"
-  },
   {
     "__type__": "cc.PrefabInfo",
     "root": {
@@ -385,7 +360,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 16
+      "__id__": 14
     },
     "_contentSize": {
       "__type__": "cc.Size",
@@ -426,7 +401,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 19
+      "__id__": 17
     },
     "_contentSize": {
       "__type__": "cc.Size",
@@ -454,7 +429,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 21
+      "__id__": 19
     },
     "_customMaterial": null,
     "_srcBlendFactor": 2,
@@ -499,7 +474,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 23
+      "__id__": 21
     },
     "tag": 2,
     "_group": 4,
@@ -570,7 +545,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 25
+      "__id__": 23
     },
     "enabledContactListener": true,
     "bullet": false,
@@ -594,6 +569,29 @@
     "__type__": "cc.CompPrefabInfo",
     "fileId": "992/Rw09lBQIO6kfz8uFhm"
   },
+  {
+    "__type__": "e2fb10lUiVLvaLrttZW1KXR",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 25
+    },
+    "pelletPrefab": {
+      "__uuid__": "54638943-4461-43b1-b351-a0380e1f30ce",
+      "__expectedType__": "cc.Prefab"
+    },
+    "fireInterval": 1,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "a9bc5h5iNK4IjDz2TEIy2k"
+  },
   {
     "__type__": "cc.PrefabInfo",
     "root": {

+ 2 - 2
assets/resources/data/weapons.json

@@ -107,7 +107,7 @@
           "penetration": 999,
           "ricochetCount": 0,
           "returnToOrigin": false,
-          "maxRange": 400
+          "maxRange": 1000
         },
         "visual": {
           "bulletPrefab": "bullets/CarrotBullet",
@@ -445,7 +445,7 @@
           "penetration": 1,
           "ricochetCount": 0,
           "returnToOrigin": false,
-          "maxRange": 200
+          "maxRange": 2000
         },
         "visual": {
           "bulletPrefab": "bullets/CactusBullet",

+ 1 - 1
assets/scripts/CombatSystem/BlockManager.ts

@@ -46,7 +46,7 @@ export class BlockManager extends Component {
     public blockMoveCooldown: number = 1;
     
     // 玩家金币数量
-    private playerCoins: number = 699;
+    private playerCoins: number = 69999;
     
     // 方块价格标签映射
     private blockPriceMap: Map<Node, Node> = new Map();

+ 80 - 5
assets/scripts/CombatSystem/WeaponBullet.ts

@@ -1,4 +1,4 @@
-import { _decorator, Component, Node, Vec2, Vec3, RigidBody2D, Collider2D, Contact2DType, IPhysics2DContact, find, Prefab, instantiate, UITransform, resources, sp, JsonAsset } from 'cc';
+import { _decorator, Component, Node, Vec2, Vec3, RigidBody2D, Collider2D, Contact2DType, IPhysics2DContact, find, Prefab, instantiate, UITransform, resources, sp, JsonAsset, Sprite, SpriteFrame, math } from 'cc';
 import { BulletCount, BulletCountConfig, BulletSpawnInfo } from './BulletEffects/BulletCount';
 import { BulletTrajectory, BulletTrajectoryConfig } from './BulletEffects/BulletTrajectory';
 import { BulletHitEffect, HitEffectConfig, HitResult } from './BulletEffects/BulletHitEffect';
@@ -64,6 +64,10 @@ export class WeaponBullet extends Component {
     // === 静态武器配置缓存 ===
     private static weaponsData: any = null;
     
+    // === 自动旋转相关 ===
+    private readonly _rotationSpeedDeg: number = 720; // 每秒旋转 720° (度)
+    private readonly _rotationSpeedRad: number = 720 * Math.PI / 180; // 转换为弧度,用于物理角速度
+    
     /**
      * 加载武器配置数据
      */
@@ -206,6 +210,9 @@ export class WeaponBullet extends Component {
         // 确保物理组件存在
         this.setupPhysics();
         
+        // 设置物理角速度,实现持续旋转
+        this.applyAutoRotation();
+        
         // 初始化弹道组件
         this.bulletTrajectory = this.getComponent(BulletTrajectory) || this.addComponent(BulletTrajectory);
         const trajCfg: BulletTrajectoryConfig = { ...config.trajectory, speed: this.weaponConfig.stats.bulletSpeed };
@@ -219,6 +226,9 @@ export class WeaponBullet extends Component {
             initData.firePosition
         );
         
+        // 设置子弹的外观(SpriteFrame 与武器方块一致)
+        this.setupBulletSprite();
+        
         // --- 额外偏移 ---
         // 若子弹在生成时与发射方块碰撞(位置重叠), 会立刻触发碰撞事件导致被销毁。
         // 因此在初始化完弹道后, 将子弹沿发射方向平移一小段距离(默认 30 像素左右)。
@@ -350,6 +360,10 @@ export class WeaponBullet extends Component {
         if (!this.isInitialized) return;
         
         const otherNode = otherCollider.node;
+        // Ignore collisions with other bullets (prevent friendly-fire between shotgun pellets)
+        if (otherNode.getComponent(WeaponBullet)) {
+            return; // Skip further processing if the collider is another bullet
+        }
         console.log(`💥 子弹碰撞: ${otherNode.name}`);
         
         // 获取碰撞世界坐标
@@ -380,10 +394,20 @@ export class WeaponBullet extends Component {
         }
     }
     
-    update(dt: number) {
-        // 生命周期检查由BulletLifecycle组件处理
-        // 弹道更新由BulletTrajectory组件处理
-        // 不需要在这里做额外处理
+    /**
+     * 为子弹设置持续旋转(通过刚体角速度,避免被物理系统覆盖)
+     */
+    private applyAutoRotation() {
+        const rigidBody = this.getComponent(RigidBody2D);
+        if (rigidBody) {
+            rigidBody.angularVelocity = this._rotationSpeedRad; // 弧度/秒
+            rigidBody.angularDamping = 0; // 无角阻尼,保持恒定旋转
+        } else {
+            // 如果没有刚体,退化为在 update 中手动旋转
+            this.schedule((dt: number) => {
+                this.node.angle += this._rotationSpeedDeg * dt;
+            }, 0);
+        }
     }
     
     /**
@@ -435,4 +459,55 @@ export class WeaponBullet extends Component {
             collider.off(Contact2DType.BEGIN_CONTACT, this.onHit, this);
         }
     }
+    
+    /**
+     * 设置子弹的SpriteFrame,使其与方块武器 (WeaponBlock/B1/Weapon) 节点上的SpriteFrame 一致
+     */
+    private setupBulletSprite() {
+        // 先尝试获取当前节点上的 Sprite 组件,若不存在则在子节点中查找
+        const sprite: Sprite | null = this.getComponent(Sprite) || this.node.getComponentInChildren(Sprite);
+        if (!sprite) {
+            // 子弹预制体可能没有Sprite组件,直接返回
+            return;
+        }
+
+        // weaponConfig.visualConfig.weaponSprites 中存储了各尺寸的SpriteFrame路径
+        const spriteConfig = (this.weaponConfig as any)?.visualConfig?.weaponSprites;
+        if (!spriteConfig) {
+            return;
+        }
+
+        // 依次尝试常用尺寸键值
+        const spritePath = spriteConfig['1x1'] || spriteConfig['1x2'] || spriteConfig['2x1'] || spriteConfig['2x2'];
+        if (!spritePath) {
+            return;
+        }
+
+        const framePath = `${spritePath}/spriteFrame`;
+        resources.load(framePath, SpriteFrame, (err, spriteFrame) => {
+            if (err) {
+                console.warn(`加载子弹SpriteFrame失败: ${framePath}`, err);
+                return;
+            }
+
+            if (sprite && spriteFrame) {
+                sprite.spriteFrame = spriteFrame;
+
+                // === 缩小至原始尺寸的 0.5 倍 ===
+                const uiTransform = sprite.node.getComponent(UITransform);
+                if (uiTransform) {
+                    const originalSize = spriteFrame.originalSize || null;
+                    if (originalSize) {
+                        uiTransform.setContentSize(originalSize.width * 0.5, originalSize.height * 0.5);
+                    } else {
+                        // 若无法获取原尺寸,退化为缩放节点
+                        sprite.node.setScale(sprite.node.scale.x * 0.5, sprite.node.scale.y * 0.5, sprite.node.scale.z);
+                    }
+                } else {
+                    // 没有 UITransform,直接缩放节点
+                    sprite.node.setScale(sprite.node.scale.x * 0.5, sprite.node.scale.y * 0.5, sprite.node.scale.z);
+                }
+            }
+        });
+    }
 } 

+ 1 - 1
assets/scripts/test.meta

@@ -2,7 +2,7 @@
   "ver": "1.2.0",
   "importer": "directory",
   "imported": true,
-  "uuid": "934a5014-666a-4731-ac09-e3ad814f6f00",
+  "uuid": "ed5be3dd-a9df-42a2-9eca-778104ed34b3",
   "files": [],
   "subMetas": {},
   "userData": {}

+ 0 - 86
assets/scripts/test/ArcBullet.ts

@@ -1,86 +0,0 @@
-import { _decorator, Component, Node, Vec3, v3 } from 'cc';
-const { ccclass, property } = _decorator;
-
-/**
- * ArcBullet
- * 负责控制子弹沿弧线(曲线)飞行
- * 思路:
- * 1. 初始化时给子弹一个带有随机左右偏移的初始方向(45°)。
- * 2. 在 update 中使用 Vec3.slerp 将当前方向逐步朝向目标方向插值,形成弧线效果。
- * 3. 用方向 * 速度 * dt 更新 worldPosition 即可。
- */
-@ccclass('ArcBullet')
-export class ArcBullet extends Component {
-    /** 子弹飞行速度(像素/秒) */
-    @property
-    public moveSpeed: number = 800;
-
-    /** 转向速率(0~1 越大越快) */
-    @property
-    public rotateSpeed: number = 0.5;
-
-    /** 追踪目标(可选)。不设置则默认向屏幕上方飞行。 */
-    @property(Node)
-    public target: Node | null = null;
-
-    // 当前方向
-    private _dir: Vec3 = new Vec3();
-
-    start() {
-        const pos = this.node.worldPosition;
-
-        // 计算目标点
-        let targetPos: Vec3;
-        if (this.target && this.target.isValid) {
-            targetPos = this.target.worldPosition.clone();
-        } else {
-            // 没有目标时,默认向上方 1200 像素处飞行
-            targetPos = v3(pos.x, pos.y + 1200, pos.z);
-        }
-
-        // 朝向目标的单位向量
-        const dirToTarget = targetPos.subtract(pos).normalize();
-
-        // 在初始方向基础上增加 45° 随机左右偏转,形成弧线起始
-        const sign = Math.random() < 0.5 ? 1 : -1; // +1 向左,-1 向右
-        const rad = 45 * Math.PI / 180 * sign;
-        const cos = Math.cos(rad);
-        const sin = Math.sin(rad);
-
-        const offsetDir = new Vec3(
-            dirToTarget.x * cos - dirToTarget.y * sin,
-            dirToTarget.x * sin + dirToTarget.y * cos,
-            0
-        ).normalize();
-
-        this._dir.set(offsetDir);
-    }
-
-    update(dt: number) {
-        if (dt === 0) return;
-
-        // 如果有有效目标,则逐步朝向目标
-        if (this.target && this.target.isValid) {
-            const pos = this.node.worldPosition;
-            const dirToTarget = this.target.worldPosition.clone().subtract(pos).normalize();
-
-            // 根据距离动态调整转向速率:越近转得越快,避免近距离打圈
-            const distance = Vec3.distance(pos, this.target.worldPosition);
-            // 基础转向速率(可调节 rotateSpeed),距离越小,factor 越大
-            const factor = this.rotateSpeed * dt * (2000 / Math.max(distance, 50));
-
-            const newDir = new Vec3();
-            Vec3.slerp(newDir, this._dir, dirToTarget, Math.min(1, factor));
-            this._dir.set(newDir);
-        }
-
-        // 位移更新
-        const displacement = this._dir.clone().multiplyScalar(this.moveSpeed * dt);
-        this.node.worldPosition = this.node.worldPosition.add(displacement);
-
-        // 超出屏幕范围时自动销毁(简易处理)
-        if (Math.abs(this.node.worldPosition.x) > 4000 || Math.abs(this.node.worldPosition.y) > 4000) {
-            this.node.destroy();
-        }
-    }
-} 

+ 0 - 68
assets/scripts/test/AutoFireWeapon.ts

@@ -1,68 +0,0 @@
-import { _decorator, Component, Prefab, instantiate, Node, Vec3, macro, find } from 'cc';
-import { ArcBullet } from './ArcBullet';
-const { ccclass, property } = _decorator;
-
-/**
- * AutoFireWeapon
- * 绑定在武器(Block001)节点上的脚本,负责定时发射子弹。
- */
-@ccclass('AutoFireWeapon')
-export class AutoFireWeapon extends Component {
-    /** 将 Pellet 预制体拖到此处 */
-    @property(Prefab)
-    public bulletPrefab: Prefab | null = null;
-
-    /** 射速:两发子弹之间的间隔(秒) */
-    @property
-    public fireInterval: number = 0.5;
-
-    /** 子弹速度(像素/秒) */
-    @property
-    public bulletSpeed: number = 800;
-
-    /** 子弹转向速率(0~1) */
-    @property
-    public rotateSpeed: number = 0.5;
-
-    /** 目标敌人(可选)。不设置则在 Canvas 下查找名为 Enemy 的节点 */
-    @property({ type: Node, tooltip: '敌人节点(如果为空,则自动在 Canvas 下查找名为 Enemy 的节点)' })
-    public enemyNode: Node | null = null;
-
-    onEnable() {
-        // 若未指定敌人,尝试在场景中查找
-        if (!this.enemyNode) {
-            this.enemyNode = find('Canvas/Enemy');
-        }
-        // 立即发射一枚,然后按间隔循环
-        this.schedule(this.spawnBullet.bind(this), this.fireInterval, macro.REPEAT_FOREVER, 0);
-    }
-
-    onDisable() {
-        this.unscheduleAllCallbacks();
-    }
-
-    private spawnBullet() {
-        if (!this.bulletPrefab) {
-            console.warn('[AutoFireWeapon] 未设置 bulletPrefab');
-            return;
-        }
-
-        // 实例化子弹
-        const bullet = instantiate(this.bulletPrefab);
-        if (!bullet) return;
-
-        // 将子弹添加到场景
-        this.node.parent?.addChild(bullet);
-
-        // 将子弹世界位置设置为武器当前位置
-        const worldPos = this.node.worldPosition;
-        bullet.setWorldPosition(new Vec3(worldPos.x, worldPos.y, worldPos.z));
-
-        // 配置 ArcBullet 组件
-        const arcBullet = bullet.getComponent(ArcBullet) || bullet.addComponent(ArcBullet);
-        arcBullet.moveSpeed = this.bulletSpeed;
-        arcBullet.rotateSpeed = this.rotateSpeed;
-        arcBullet.target = this.enemyNode;
-        // 可根据需要设置 arcBullet.target = 某个目标节点
-    }
-} 

+ 0 - 9
assets/scripts/test/AutoFireWeapon.ts.meta

@@ -1,9 +0,0 @@
-{
-  "ver": "4.0.24",
-  "importer": "typescript",
-  "imported": true,
-  "uuid": "1325e05e-6515-47e4-a6c5-b82d8949f798",
-  "files": [],
-  "subMetas": {},
-  "userData": {}
-}

+ 102 - 0
assets/scripts/test/WeaponRandomSpawner.ts

@@ -0,0 +1,102 @@
+import { _decorator, Component, Node, Sprite, SpriteFrame, resources, Prefab, instantiate, UITransform, Vec2, Vec3, RigidBody2D, macro } from 'cc';
+const { ccclass, property } = _decorator;
+
+@ccclass('WeaponRandomSpawner')
+export class WeaponRandomSpawner extends Component {
+    /**
+     * Pellet prefab used as bullet. Drag the Pellet.prefab into this slot in the editor.
+     */
+    @property({ type: Prefab })
+    public pelletPrefab: Prefab | null = null;
+
+    /**
+     * Time interval (seconds) between two shots.
+     */
+    @property
+    public fireInterval: number = 1.0;
+
+    /** Cached weapon sprite component (WeaponBlock/B1/Weapon) */
+    private _weaponSprite: Sprite | null = null;
+    /** The sprite frame chosen randomly at scene start */
+    private _selectedFrame: SpriteFrame | null = null;
+
+    onLoad() {
+        // Locate the Weapon sprite component inside the prefab hierarchy
+        const b1Node: Node | null = this.node.getChildByName('B1');
+        if (!b1Node) {
+            console.error('[WeaponRandomSpawner] Cannot find child node "B1"');
+            return;
+        }
+        const weaponNode: Node | null = b1Node.getChildByName('Weapon');
+        if (!weaponNode) {
+            console.error('[WeaponRandomSpawner] Cannot find grand-child node "Weapon" under B1');
+            return;
+        }
+        this._weaponSprite = weaponNode.getComponent(Sprite);
+        if (!this._weaponSprite) {
+            console.error('[WeaponRandomSpawner] Sprite component missing on Weapon node');
+            return;
+        }
+
+        // Load all sprite frames under resources/images/PlantsSprite at runtime
+        resources.loadDir('images/PlantsSprite', SpriteFrame, (err, assets) => {
+            if (err) {
+                console.error('[WeaponRandomSpawner] Failed to load PlantsSprite resources:', err);
+                return;
+            }
+            if (!assets || assets.length === 0) {
+                console.warn('[WeaponRandomSpawner] No sprite frames found in images/PlantsSprite');
+                return;
+            }
+
+            // Pick one sprite frame randomly and apply to weapon
+            this._selectedFrame = assets[Math.floor(Math.random() * assets.length)];
+            if (this._weaponSprite) {
+                this._weaponSprite.spriteFrame = this._selectedFrame;
+            }
+        });
+    }
+
+    start() {
+        // Start auto-fire schedule
+        this.schedule(this._fire.bind(this), this.fireInterval);
+    }
+
+    /**
+     * Instantiate a bullet prefab, copy the weapon sprite frame to it (scaled to half size)
+     * and give it an upward velocity.
+     */
+    private _fire() {
+        if (!this.pelletPrefab || !this._selectedFrame) {
+            return; // Not ready yet
+        }
+
+        const bullet: Node = instantiate(this.pelletPrefab);
+        // Add to the same scene, at world position of the weapon muzzle (current node)
+        this.node.scene?.addChild(bullet);
+        bullet.setWorldPosition(this.node.worldPosition);
+
+        // Set bullet sprite frame
+        const bulletSprite = bullet.getComponent(Sprite);
+        if (bulletSprite) {
+            bulletSprite.spriteFrame = this._selectedFrame;
+        }
+
+        // Match bullet size to half of weapon sprite size
+        const weaponUi = this._weaponSprite?.node.getComponent(UITransform);
+        const bulletUi = bullet.getComponent(UITransform);
+        if (weaponUi && bulletUi) {
+            const size = weaponUi.contentSize;
+            bulletUi.setContentSize(size.width * 0.5, size.height * 0.5);
+        } else {
+            // Fallback: scale the whole node
+            bullet.setScale(this.node.scale.x * 0.5, this.node.scale.y * 0.5, 1);
+        }
+
+        // Give the bullet an upward velocity if it has a RigidBody2D component
+        const rb = bullet.getComponent(RigidBody2D);
+        if (rb) {
+            rb.linearVelocity = new Vec2(0, 600);
+        }
+    }
+} 

+ 1 - 1
assets/scripts/test/ArcBullet.ts.meta → assets/scripts/test/WeaponRandomSpawner.ts.meta

@@ -2,7 +2,7 @@
   "ver": "4.0.24",
   "importer": "typescript",
   "imported": true,
-  "uuid": "8af2e872-503d-4978-aeab-7c4725209721",
+  "uuid": "e2fb1d25-5225-4bbd-a2eb-b6d656d4a5d1",
   "files": [],
   "subMetas": {},
   "userData": {}