feat: 完成碰撞以及攻击逻辑

This commit is contained in:
richarjiang
2025-09-22 16:41:31 +08:00
parent 1f0771b271
commit dd263b6481
42 changed files with 2648 additions and 75 deletions

View File

@@ -52,7 +52,7 @@
},
"autoReleaseAssets": false,
"_globals": {
"__id__": 36
"__id__": 40
},
"_id": "58132e64-0171-4c7f-89be-a2984ca7de6b"
},
@@ -69,19 +69,19 @@
"__id__": 3
},
{
"__id__": 10
"__id__": 12
},
{
"__id__": 20
"__id__": 22
},
{
"__id__": 23
"__id__": 25
},
{
"__id__": 26
"__id__": 28
},
{
"__id__": 29
"__id__": 31
},
{
"__id__": 6
@@ -90,13 +90,13 @@
"_active": true,
"_components": [
{
"__id__": 33
"__id__": 37
},
{
"__id__": 34
"__id__": 38
},
{
"__id__": 35
"__id__": 39
}
],
"_prefab": null,
@@ -267,6 +267,12 @@
},
{
"__id__": 9
},
{
"__id__": 10
},
{
"__id__": 11
}
],
"_prefab": null,
@@ -344,6 +350,10 @@
{
"__uuid__": "1cae9705-74b5-4828-955a-0509c344873d",
"__expectedType__": "cc.AnimationClip"
},
{
"__uuid__": "a07c81b6-e4f7-4534-8ecc-2ee9db2f9936",
"__expectedType__": "cc.AnimationClip"
}
],
"_defaultClip": {
@@ -391,6 +401,62 @@
"_atlas": null,
"_id": "1f9/F2IKtCf4htX1i8Q4/O"
},
{
"__type__": "cc.RigidBody2D",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 6
},
"_enabled": true,
"__prefab": null,
"enabledContactListener": true,
"bullet": false,
"awakeOnLoad": true,
"_group": 1,
"_type": 1,
"_allowSleep": true,
"_gravityScale": 0,
"_linearDamping": 0,
"_angularDamping": 0,
"_linearVelocity": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_angularVelocity": 0,
"_fixedRotation": true,
"_id": "82hPtgJjdFX7LAqMF3trgK"
},
{
"__type__": "cc.BoxCollider2D",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 6
},
"_enabled": true,
"__prefab": null,
"tag": 0,
"_group": 1,
"_density": 1,
"_sensor": false,
"_friction": 0.2,
"_restitution": 0,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_size": {
"__type__": "cc.Size",
"width": 51,
"height": 120
},
"_id": "634GiEUhBB8Z1aGzkT6Zyd"
},
{
"__type__": "cc.Node",
"_name": "TiledMap",
@@ -401,22 +467,22 @@
},
"_children": [
{
"__id__": 11
"__id__": 13
},
{
"__id__": 14
"__id__": 16
}
],
"_active": true,
"_components": [
{
"__id__": 17
},
{
"__id__": 18
},
{
"__id__": 19
},
{
"__id__": 20
},
{
"__id__": 21
}
],
"_prefab": null,
@@ -455,16 +521,16 @@
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 10
"__id__": 12
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 12
"__id__": 14
},
{
"__id__": 13
"__id__": 15
}
],
"_prefab": null,
@@ -503,7 +569,7 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 11
"__id__": 13
},
"_enabled": true,
"__prefab": null,
@@ -525,7 +591,7 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 11
"__id__": 13
},
"_enabled": true,
"__prefab": null,
@@ -564,16 +630,16 @@
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 10
"__id__": 12
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 15
"__id__": 17
},
{
"__id__": 16
"__id__": 18
}
],
"_prefab": null,
@@ -612,7 +678,7 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 14
"__id__": 16
},
"_enabled": true,
"__prefab": null,
@@ -634,7 +700,7 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 14
"__id__": 16
},
"_enabled": true,
"__prefab": null,
@@ -656,7 +722,7 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 10
"__id__": 12
},
"_enabled": true,
"__prefab": null,
@@ -678,7 +744,7 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 10
"__id__": 12
},
"_enabled": true,
"__prefab": null,
@@ -696,12 +762,12 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 10
"__id__": 12
},
"_enabled": true,
"__prefab": null,
"tiledMap": {
"__id__": 18
"__id__": 20
},
"walkableLayerName": "WalkableLayer",
"tileSize": 32,
@@ -719,10 +785,10 @@
"_active": false,
"_components": [
{
"__id__": 21
"__id__": 23
},
{
"__id__": 22
"__id__": 24
}
],
"_prefab": null,
@@ -761,7 +827,7 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 20
"__id__": 22
},
"_enabled": true,
"__prefab": null,
@@ -783,7 +849,7 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 20
"__id__": 22
},
"_enabled": true,
"__prefab": null,
@@ -828,10 +894,10 @@
"_active": true,
"_components": [
{
"__id__": 24
"__id__": 26
},
{
"__id__": 25
"__id__": 27
}
],
"_prefab": null,
@@ -870,7 +936,7 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 23
"__id__": 25
},
"_enabled": true,
"__prefab": null,
@@ -892,7 +958,7 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 23
"__id__": 25
},
"_enabled": true,
"__prefab": null,
@@ -903,7 +969,7 @@
"__id__": 4
},
"pathfinder": {
"__id__": 19
"__id__": 21
},
"moveSpeed": 300,
"mapWidth": 1080,
@@ -922,10 +988,10 @@
"_active": true,
"_components": [
{
"__id__": 27
"__id__": 29
},
{
"__id__": 28
"__id__": 30
}
],
"_prefab": null,
@@ -964,7 +1030,7 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 26
"__id__": 28
},
"_enabled": true,
"__prefab": null,
@@ -986,12 +1052,12 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 26
"__id__": 28
},
"_enabled": true,
"__prefab": null,
"tiledMap": {
"__id__": 18
"__id__": 20
},
"playerNode": {
"__id__": 6
@@ -1000,7 +1066,7 @@
},
{
"__type__": "cc.Node",
"_name": "Guai",
"_name": "guai_1",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
@@ -1009,14 +1075,20 @@
"_children": [],
"_active": true,
"_components": [
{
"__id__": 30
},
{
"__id__": 31
},
{
"__id__": 32
},
{
"__id__": 33
},
{
"__id__": 34
},
{
"__id__": 35
},
{
"__id__": 36
}
],
"_prefab": null,
@@ -1055,7 +1127,7 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 29
"__id__": 31
},
"_enabled": true,
"__prefab": null,
@@ -1077,7 +1149,7 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 29
"__id__": 31
},
"_enabled": true,
"__prefab": null,
@@ -1116,15 +1188,19 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 29
"__id__": 31
},
"_enabled": true,
"__prefab": null,
"playOnLoad": false,
"playOnLoad": true,
"_clips": [
{
"__uuid__": "54ef783f-23da-4784-bee8-1869d746b41a",
"__expectedType__": "cc.AnimationClip"
},
{
"__uuid__": "88fe4ee4-900d-44af-a405-32ff388218da",
"__expectedType__": "cc.AnimationClip"
}
],
"_defaultClip": {
@@ -1133,6 +1209,62 @@
},
"_id": "70f6J4ahJE5qUWJaUcvYje"
},
{
"__type__": "cc.RigidBody2D",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 31
},
"_enabled": true,
"__prefab": null,
"enabledContactListener": false,
"bullet": false,
"awakeOnLoad": true,
"_group": 1,
"_type": 0,
"_allowSleep": true,
"_gravityScale": 0,
"_linearDamping": 0,
"_angularDamping": 0,
"_linearVelocity": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_angularVelocity": 0,
"_fixedRotation": true,
"_id": "54p0eTw2dLQ5ABP01NLPhM"
},
{
"__type__": "cc.BoxCollider2D",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 31
},
"_enabled": true,
"__prefab": null,
"tag": 0,
"_group": 1,
"_density": 1,
"_sensor": false,
"_friction": 0.2,
"_restitution": 0,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_size": {
"__type__": "cc.Size",
"width": 56,
"height": 119
},
"_id": "cdIXFZyqRL66Jq6KOCWAZ6"
},
{
"__type__": "cc.UITransform",
"_name": "",
@@ -1204,29 +1336,29 @@
{
"__type__": "cc.SceneGlobals",
"ambient": {
"__id__": 37
},
"shadows": {
"__id__": 38
},
"_skybox": {
"__id__": 39
},
"fog": {
"__id__": 40
},
"octree": {
"__id__": 41
},
"skin": {
"shadows": {
"__id__": 42
},
"lightProbeInfo": {
"_skybox": {
"__id__": 43
},
"postSettings": {
"fog": {
"__id__": 44
},
"octree": {
"__id__": 45
},
"skin": {
"__id__": 46
},
"lightProbeInfo": {
"__id__": 47
},
"postSettings": {
"__id__": 48
},
"bakedWithStationaryMainLight": false,
"bakedWithHighpLightmap": false
},