3 Commits

Author SHA1 Message Date
5bd2e15fb5 refactor(skill): 优化技能碰撞检测逻辑并移除重复命中检查
- 移除hitTargets集合及相关重复命中检查逻辑
- 改进碰撞检测日志输出,增加安全性检查
- 清理注释掉的旧攻击逻辑代码
- 在reset方法中添加碰撞器事件解绑
2025-11-03 10:57:08 +08:00
e4905bcca2 fix(physics): 启用物理调试绘制并设置英雄碰撞组
启用AABB和质心的物理调试绘制标志,并在HeroViewComp中设置碰撞器组为英雄组
2025-11-03 10:56:32 +08:00
5805e00895 feat(skill): 添加彩色箭头技能资源及配置
- 新增红、蓝、绿三种箭头技能的prefab和动画资源
- 更新技能配置文件和英雄设置
- 调整水球技能物理参数
- 优化碰撞矩阵设置
- 修复动画时间精度问题
2025-11-03 10:56:03 +08:00
21 changed files with 1498 additions and 221 deletions

View File

@@ -996,7 +996,7 @@
"__id__": 62 "__id__": 62
}, },
"tag": 0, "tag": 0,
"_group": 4, "_group": 2,
"_density": 1, "_density": 1,
"_sensor": true, "_sensor": true,
"_friction": 0.2, "_friction": 0.2,

View File

@@ -996,9 +996,9 @@
"__id__": 62 "__id__": 62
}, },
"tag": 0, "tag": 0,
"_group": 4, "_group": 2,
"_density": 1, "_density": 1,
"_sensor": true, "_sensor": false,
"_friction": 0.2, "_friction": 0.2,
"_restitution": 0, "_restitution": 0,
"_offset": { "_offset": {

View File

@@ -88,7 +88,7 @@
"__type__": "cc.RealCurve", "__type__": "cc.RealCurve",
"_times": [ "_times": [
0, 0,
0.1 0.10000000149011612
], ],
"_values": [ "_values": [
{ {
@@ -133,7 +133,7 @@
"__type__": "cc.RealCurve", "__type__": "cc.RealCurve",
"_times": [ "_times": [
0, 0,
0.1 0.10000000149011612
], ],
"_values": [ "_values": [
{ {
@@ -178,7 +178,7 @@
"__type__": "cc.RealCurve", "__type__": "cc.RealCurve",
"_times": [ "_times": [
0, 0,
0.1 0.10000000149011612
], ],
"_values": [ "_values": [
{ {
@@ -280,8 +280,8 @@
"__type__": "cc.RealCurve", "__type__": "cc.RealCurve",
"_times": [ "_times": [
0, 0,
0.06666666666666667, 0.06666667014360428,
0.1 0.10000000149011612
], ],
"_values": [ "_values": [
{ {
@@ -340,8 +340,8 @@
"__type__": "cc.RealCurve", "__type__": "cc.RealCurve",
"_times": [ "_times": [
0, 0,
0.06666666666666667, 0.06666667014360428,
0.1 0.10000000149011612
], ],
"_values": [ "_values": [
{ {
@@ -400,8 +400,8 @@
"__type__": "cc.RealCurve", "__type__": "cc.RealCurve",
"_times": [ "_times": [
0, 0,
0.06666666666666667, 0.06666667014360428,
0.1 0.10000000149011612
], ],
"_values": [ "_values": [
{ {
@@ -460,8 +460,8 @@
"__type__": "cc.RealCurve", "__type__": "cc.RealCurve",
"_times": [ "_times": [
0, 0,
0.06666666666666667, 0.06666667014360428,
0.1 0.10000000149011612
], ],
"_values": [ "_values": [
{ {

View File

@@ -0,0 +1,100 @@
[
{
"__type__": "cc.AnimationClip",
"_name": "atk_arrow_blue",
"_objFlags": 0,
"__editorExtras__": {
"embeddedPlayerGroups": []
},
"_native": "",
"sample": 24,
"speed": 1,
"wrapMode": 2,
"enableTrsBlending": false,
"_duration": 0.16666666666666666,
"_hash": 500763545,
"_tracks": [
{
"__id__": 1
}
],
"_exoticAnimation": null,
"_events": [],
"_embeddedPlayers": [],
"_additiveSettings": {
"__id__": 7
},
"_auxiliaryCurveEntries": []
},
{
"__type__": "cc.animation.ObjectTrack",
"_binding": {
"__type__": "cc.animation.TrackBinding",
"path": {
"__id__": 2
},
"proxy": null
},
"_channel": {
"__id__": 5
}
},
{
"__type__": "cc.animation.TrackPath",
"_paths": [
{
"__id__": 3
},
{
"__id__": 4
},
"spriteFrame"
]
},
{
"__type__": "cc.animation.HierarchyPath",
"path": "E"
},
{
"__type__": "cc.animation.ComponentPath",
"component": "cc.Sprite"
},
{
"__type__": "cc.animation.Channel",
"_curve": {
"__id__": 6
}
},
{
"__type__": "cc.ObjectCurve",
"_times": [
0,
0.041666666666666664,
0.08333333333333333,
0.125
],
"_values": [
{
"__uuid__": "3d46f945-3f07-477e-a95a-b49557d552c6@a22e7",
"__expectedType__": "cc.SpriteFrame"
},
{
"__uuid__": "3d46f945-3f07-477e-a95a-b49557d552c6@20740",
"__expectedType__": "cc.SpriteFrame"
},
{
"__uuid__": "3d46f945-3f07-477e-a95a-b49557d552c6@35944",
"__expectedType__": "cc.SpriteFrame"
},
{
"__uuid__": "3d46f945-3f07-477e-a95a-b49557d552c6@b9343",
"__expectedType__": "cc.SpriteFrame"
}
]
},
{
"__type__": "cc.AnimationClipAdditiveSettings",
"enabled": false,
"refClip": null
}
]

View File

@@ -0,0 +1,13 @@
{
"ver": "2.0.3",
"importer": "animation-clip",
"imported": true,
"uuid": "717b5364-8e77-4a5c-a0f0-81c613275b4e",
"files": [
".cconb"
],
"subMetas": {},
"userData": {
"name": "atk_arrow_green"
}
}

View File

@@ -0,0 +1,100 @@
[
{
"__type__": "cc.AnimationClip",
"_name": "atk_arrow_red",
"_objFlags": 0,
"__editorExtras__": {
"embeddedPlayerGroups": []
},
"_native": "",
"sample": 24,
"speed": 1,
"wrapMode": 2,
"enableTrsBlending": false,
"_duration": 0.16666666666666666,
"_hash": 500763545,
"_tracks": [
{
"__id__": 1
}
],
"_exoticAnimation": null,
"_events": [],
"_embeddedPlayers": [],
"_additiveSettings": {
"__id__": 7
},
"_auxiliaryCurveEntries": []
},
{
"__type__": "cc.animation.ObjectTrack",
"_binding": {
"__type__": "cc.animation.TrackBinding",
"path": {
"__id__": 2
},
"proxy": null
},
"_channel": {
"__id__": 5
}
},
{
"__type__": "cc.animation.TrackPath",
"_paths": [
{
"__id__": 3
},
{
"__id__": 4
},
"spriteFrame"
]
},
{
"__type__": "cc.animation.HierarchyPath",
"path": "E"
},
{
"__type__": "cc.animation.ComponentPath",
"component": "cc.Sprite"
},
{
"__type__": "cc.animation.Channel",
"_curve": {
"__id__": 6
}
},
{
"__type__": "cc.ObjectCurve",
"_times": [
0,
0.041666666666666664,
0.08333333333333333,
0.125
],
"_values": [
{
"__uuid__": "3d46f945-3f07-477e-a95a-b49557d552c6@1b09a",
"__expectedType__": "cc.SpriteFrame"
},
{
"__uuid__": "3d46f945-3f07-477e-a95a-b49557d552c6@341ae",
"__expectedType__": "cc.SpriteFrame"
},
{
"__uuid__": "3d46f945-3f07-477e-a95a-b49557d552c6@6459e",
"__expectedType__": "cc.SpriteFrame"
},
{
"__uuid__": "3d46f945-3f07-477e-a95a-b49557d552c6@820a5",
"__expectedType__": "cc.SpriteFrame"
}
]
},
{
"__type__": "cc.AnimationClipAdditiveSettings",
"enabled": false,
"refClip": null
}
]

View File

@@ -0,0 +1,13 @@
{
"ver": "2.0.3",
"importer": "animation-clip",
"imported": true,
"uuid": "4c6dbd6c-4ecc-4f66-a1e0-89083ec7939f",
"files": [
".cconb"
],
"subMetas": {},
"userData": {
"name": "atk_arrow_red"
}
}

View File

@@ -24,6 +24,12 @@
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{
"__id__": 8
},
{
"__id__": 10
},
{ {
"__id__": 12 "__id__": 12
}, },
@@ -32,16 +38,10 @@
}, },
{ {
"__id__": 16 "__id__": 16
},
{
"__id__": 18
},
{
"__id__": 20
} }
], ],
"_prefab": { "_prefab": {
"__id__": 22 "__id__": 18
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@@ -88,16 +88,10 @@
}, },
{ {
"__id__": 5 "__id__": 5
},
{
"__id__": 7
},
{
"__id__": 9
} }
], ],
"_prefab": { "_prefab": {
"__id__": 11 "__id__": 7
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@@ -201,74 +195,6 @@
"__type__": "cc.CompPrefabInfo", "__type__": "cc.CompPrefabInfo",
"fileId": "12eKc8gltBz50frJCS5+ww" "fileId": "12eKc8gltBz50frJCS5+ww"
}, },
{
"__type__": "cc.RigidBody2D",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 8
},
"enabledContactListener": false,
"bullet": false,
"awakeOnLoad": true,
"_group": 1,
"_type": 2,
"_allowSleep": true,
"_gravityScale": 1,
"_linearDamping": 0,
"_angularDamping": 0,
"_linearVelocity": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_angularVelocity": 0,
"_fixedRotation": false,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "98cPYmJhNA4J/GZdhUWQGv"
},
{
"__type__": "cc.BoxCollider2D",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 10
},
"tag": 0,
"_group": 1,
"_density": 1,
"_sensor": false,
"_friction": 0.2,
"_restitution": 0,
"_offset": {
"__type__": "cc.Vec2",
"x": 43.5,
"y": 48.5
},
"_size": {
"__type__": "cc.Size",
"width": 87,
"height": 97
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "63V4BzNKRDzYi3gYIKcuRs"
},
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
"root": { "root": {
@@ -292,12 +218,12 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 13 "__id__": 9
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 240, "width": 200,
"height": 100 "height": 80
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@@ -320,7 +246,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 15 "__id__": 11
}, },
"playOnLoad": true, "playOnLoad": true,
"_clips": [ "_clips": [
@@ -343,12 +269,13 @@
"__type__": "57aabs7TE1J5obTAZczc+64", "__type__": "57aabs7TE1J5obTAZczc+64",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {},
"node": { "node": {
"__id__": 1 "__id__": 1
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 17 "__id__": 13
}, },
"atk_x": 0, "atk_x": 0,
"atk_y": 0, "atk_y": 0,
@@ -368,13 +295,13 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 19 "__id__": 15
}, },
"enabledContactListener": true, "enabledContactListener": true,
"bullet": false, "bullet": false,
"awakeOnLoad": true, "awakeOnLoad": true,
"_group": 1, "_group": 1,
"_type": 0, "_type": 1,
"_allowSleep": false, "_allowSleep": false,
"_gravityScale": 1, "_gravityScale": 1,
"_linearDamping": 0, "_linearDamping": 0,
@@ -400,9 +327,9 @@
"node": { "node": {
"__id__": 1 "__id__": 1
}, },
"_enabled": false, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 21 "__id__": 17
}, },
"tag": 0, "tag": 0,
"_group": 1, "_group": 1,
@@ -413,12 +340,12 @@
"_offset": { "_offset": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
"x": 0, "x": 0,
"y": 0 "y": 40
}, },
"_size": { "_size": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 50, "width": 200,
"height": 50 "height": 80
}, },
"_id": "" "_id": ""
}, },

View File

@@ -1,7 +1,7 @@
[ [
{ {
"__type__": "cc.Prefab", "__type__": "cc.Prefab",
"_name": "b_arrow_1", "_name": "b_arrow_blue",
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"_native": "", "_native": "",
@@ -13,7 +13,7 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "b_arrow_1", "_name": "b_arrow_blue",
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {}, "__editorExtras__": {},
"_parent": null, "_parent": null,
@@ -414,6 +414,7 @@
"__type__": "57aabs7TE1J5obTAZczc+64", "__type__": "57aabs7TE1J5obTAZczc+64",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"__editorExtras__": {},
"node": { "node": {
"__id__": 1 "__id__": 1
}, },
@@ -512,7 +513,7 @@
"tag": 0, "tag": 0,
"_group": 1, "_group": 1,
"_density": 1, "_density": 1,
"_sensor": true, "_sensor": false,
"_friction": 0.2, "_friction": 0.2,
"_restitution": 0, "_restitution": 0,
"_offset": { "_offset": {
@@ -522,7 +523,7 @@
}, },
"_size": { "_size": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 40, "width": 30,
"height": 10 "height": 10
}, },
"_id": "" "_id": ""

View File

@@ -8,6 +8,6 @@
], ],
"subMetas": {}, "subMetas": {},
"userData": { "userData": {
"syncNodeName": "b_arrow_1" "syncNodeName": "b_arrow_blue"
} }
} }

View File

@@ -0,0 +1,550 @@
[
{
"__type__": "cc.Prefab",
"_name": "b_arrow_green",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "b_arrow_green",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [
{
"__id__": 2
},
{
"__id__": 8
}
],
"_active": true,
"_components": [
{
"__id__": 14
},
{
"__id__": 16
},
{
"__id__": 18
},
{
"__id__": 20
},
{
"__id__": 22
},
{
"__id__": 24
}
],
"_prefab": {
"__id__": 26
},
"_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": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "E",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
},
{
"__id__": 5
}
],
"_prefab": {
"__id__": 7
},
"_lpos": {
"__type__": "cc.Vec3",
"x": -16.397,
"y": 0.755,
"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": 1073741824,
"_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": 74,
"height": 64
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "06BuaYuTlH7oarNLUv4Quo"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 6
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "3d46f945-3f07-477e-a95a-b49557d552c6@1b09a",
"__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": {
"__uuid__": "3d46f945-3f07-477e-a95a-b49557d552c6",
"__expectedType__": "cc.SpriteAtlas"
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "54o3uGyUNODo0HOzGkYqsA"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "5563D/YVpGlqqIyYnHSEwW",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "Node",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 9
},
{
"__id__": 11
}
],
"_prefab": {
"__id__": 13
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 8
},
"_enabled": true,
"__prefab": {
"__id__": 10
},
"_contentSize": {
"__type__": "cc.Size",
"width": 40,
"height": 6
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "93pNmvtQlLSqtTgIepyEmA"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 8
},
"_enabled": true,
"__prefab": {
"__id__": 12
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 170
},
"_spriteFrame": {
"__uuid__": "2423272e-e63b-4736-b15b-30b40cf98a23@0ab4e",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 1,
"_fillType": 0,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": {
"__uuid__": "2423272e-e63b-4736-b15b-30b40cf98a23",
"__expectedType__": "cc.SpriteAtlas"
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "12eKc8gltBz50frJCS5+ww"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "3arqAMBz1MvoXBzeDaL5M/",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 15
},
"_contentSize": {
"__type__": "cc.Size",
"width": 40,
"height": 10
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "63NP9yq3hEUKD/OZZZ5t7x"
},
{
"__type__": "cc.Animation",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 17
},
"playOnLoad": true,
"_clips": [
{
"__uuid__": "4c6dbd6c-4ecc-4f66-a1e0-89083ec7939f",
"__expectedType__": "cc.AnimationClip"
}
],
"_defaultClip": {
"__uuid__": "4c6dbd6c-4ecc-4f66-a1e0-89083ec7939f",
"__expectedType__": "cc.AnimationClip"
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "c2RDvksalG2acL3tyGCY0t"
},
{
"__type__": "57aabs7TE1J5obTAZczc+64",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 19
},
"atk_x": 0,
"atk_y": 0,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "60LInmZXxDtKu79AshRG9j"
},
{
"__type__": "f680dkagx9PmbfqtF463/Ua",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 21
},
"speed": 600,
"controlPointSide": 1,
"controlPointOffset": 0.5,
"controlPointRandomness": 0.3,
"autoRotate": false,
"showTrajectory": false,
"trajectoryColor": {
"__type__": "cc.Color",
"r": 0,
"g": 255,
"b": 0,
"a": 255
},
"trajectoryWidth": 3,
"easing": "linear",
"rotationSmoothness": 0.6,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "65YLwe9t9EXo5kI3HQEGhs"
},
{
"__type__": "cc.RigidBody2D",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 23
},
"enabledContactListener": true,
"bullet": false,
"awakeOnLoad": true,
"_group": 1,
"_type": 1,
"_allowSleep": true,
"_gravityScale": 1,
"_linearDamping": 0,
"_angularDamping": 0,
"_linearVelocity": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_angularVelocity": 0,
"_fixedRotation": false,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "e1yBA625RLwLhzo6bLYW7j"
},
{
"__type__": "cc.BoxCollider2D",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 25
},
"tag": 0,
"_group": 1,
"_density": 1,
"_sensor": true,
"_friction": 0.2,
"_restitution": 0,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_size": {
"__type__": "cc.Size",
"width": 30,
"height": 10
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "43ZDJfXX9AX73gyytKQZWm"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "c46/YsCPVOJYA4mWEpNYRx",
"instance": null,
"targetOverrides": null
}
]

View File

@@ -0,0 +1,13 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "a2517b43-21fd-458f-ab93-af99198e3f98",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "b_arrow_green"
}
}

View File

@@ -0,0 +1,550 @@
[
{
"__type__": "cc.Prefab",
"_name": "b_arrow_red",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "b_arrow_red",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [
{
"__id__": 2
},
{
"__id__": 8
}
],
"_active": true,
"_components": [
{
"__id__": 14
},
{
"__id__": 16
},
{
"__id__": 18
},
{
"__id__": 20
},
{
"__id__": 22
},
{
"__id__": 24
}
],
"_prefab": {
"__id__": 26
},
"_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": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "E",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
},
{
"__id__": 5
}
],
"_prefab": {
"__id__": 7
},
"_lpos": {
"__type__": "cc.Vec3",
"x": -16.397,
"y": 0.755,
"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": 1073741824,
"_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": 74,
"height": 64
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "06BuaYuTlH7oarNLUv4Quo"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 6
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "3d46f945-3f07-477e-a95a-b49557d552c6@a22e7",
"__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": {
"__uuid__": "3d46f945-3f07-477e-a95a-b49557d552c6",
"__expectedType__": "cc.SpriteAtlas"
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "54o3uGyUNODo0HOzGkYqsA"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "5563D/YVpGlqqIyYnHSEwW",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "Node",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 9
},
{
"__id__": 11
}
],
"_prefab": {
"__id__": 13
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 8
},
"_enabled": true,
"__prefab": {
"__id__": 10
},
"_contentSize": {
"__type__": "cc.Size",
"width": 40,
"height": 6
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "93pNmvtQlLSqtTgIepyEmA"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 8
},
"_enabled": true,
"__prefab": {
"__id__": 12
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 170
},
"_spriteFrame": {
"__uuid__": "2423272e-e63b-4736-b15b-30b40cf98a23@0ab4e",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 1,
"_fillType": 0,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": {
"__uuid__": "2423272e-e63b-4736-b15b-30b40cf98a23",
"__expectedType__": "cc.SpriteAtlas"
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "12eKc8gltBz50frJCS5+ww"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "3arqAMBz1MvoXBzeDaL5M/",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 15
},
"_contentSize": {
"__type__": "cc.Size",
"width": 40,
"height": 10
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "63NP9yq3hEUKD/OZZZ5t7x"
},
{
"__type__": "cc.Animation",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 17
},
"playOnLoad": true,
"_clips": [
{
"__uuid__": "4c6dbd6c-4ecc-4f66-a1e0-89083ec7939f",
"__expectedType__": "cc.AnimationClip"
}
],
"_defaultClip": {
"__uuid__": "4c6dbd6c-4ecc-4f66-a1e0-89083ec7939f",
"__expectedType__": "cc.AnimationClip"
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "c2RDvksalG2acL3tyGCY0t"
},
{
"__type__": "57aabs7TE1J5obTAZczc+64",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 19
},
"atk_x": 0,
"atk_y": 0,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "60LInmZXxDtKu79AshRG9j"
},
{
"__type__": "f680dkagx9PmbfqtF463/Ua",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 21
},
"speed": 600,
"controlPointSide": 1,
"controlPointOffset": 0.5,
"controlPointRandomness": 0.3,
"autoRotate": false,
"showTrajectory": false,
"trajectoryColor": {
"__type__": "cc.Color",
"r": 0,
"g": 255,
"b": 0,
"a": 255
},
"trajectoryWidth": 3,
"easing": "linear",
"rotationSmoothness": 0.6,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "65YLwe9t9EXo5kI3HQEGhs"
},
{
"__type__": "cc.RigidBody2D",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 23
},
"enabledContactListener": true,
"bullet": false,
"awakeOnLoad": true,
"_group": 1,
"_type": 1,
"_allowSleep": true,
"_gravityScale": 1,
"_linearDamping": 0,
"_angularDamping": 0,
"_linearVelocity": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_angularVelocity": 0,
"_fixedRotation": false,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "e1yBA625RLwLhzo6bLYW7j"
},
{
"__type__": "cc.BoxCollider2D",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 25
},
"tag": 0,
"_group": 1,
"_density": 1,
"_sensor": true,
"_friction": 0.2,
"_restitution": 0,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_size": {
"__type__": "cc.Size",
"width": 30,
"height": 10
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "43ZDJfXX9AX73gyytKQZWm"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "c46/YsCPVOJYA4mWEpNYRx",
"instance": null,
"targetOverrides": null
}
]

View File

@@ -0,0 +1,13 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "6b837288-dad2-4fc5-8c69-e43db81d5eb0",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "b_arrow_red"
}
}

View File

@@ -304,7 +304,7 @@
"bullet": false, "bullet": false,
"awakeOnLoad": true, "awakeOnLoad": true,
"_group": 1, "_group": 1,
"_type": 0, "_type": 1,
"_allowSleep": false, "_allowSleep": false,
"_gravityScale": 1, "_gravityScale": 1,
"_linearDamping": 0, "_linearDamping": 0,

View File

@@ -1,9 +0,0 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "e44e387b-e119-4ea3-8c61-90be55888ce5",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -12,9 +12,9 @@ const { ccclass, property } = _decorator;
@ccclass('Main') @ccclass('Main')
export class Main extends Root { export class Main extends Root {
start() { start() {
// PhysicsSystem2D.instance.debugDrawFlags = EPhysics2DDrawFlags.Aabb PhysicsSystem2D.instance.debugDrawFlags = EPhysics2DDrawFlags.Aabb
// |EPhysics2DDrawFlags.Pair // |EPhysics2DDrawFlags.Pair
// |EPhysics2DDrawFlags.CenterOfMass |EPhysics2DDrawFlags.CenterOfMass
// |EPhysics2DDrawFlags.Joint // |EPhysics2DDrawFlags.Joint
// |EPhysics2DDrawFlags.Shape; // |EPhysics2DDrawFlags.Shape;
} }

View File

@@ -138,42 +138,42 @@ export const HeroInfo: Record<number, heroInfo> = {
//怪物 //怪物
5201:{uuid:5201,name:"兽人战士",path:"mo1", fac:FacSet.MON, kind:1, 5201:{uuid:5201,name:"兽人战士",path:"mo1", fac:FacSet.MON, kind:1,
type:HType.warrior,lv:1,hp:30,mp:100,map:10,def:5,mdef:0,ap:5,dis:90,speed:100,skills:[6002], type:HType.warrior,lv:1,hp:30,mp:100,map:10,def:5,mdef:0,ap:5,dis:90,speed:100,skills:[6001],
buff:[],tal:[],info:"普通怪物-战士型"}, buff:[],tal:[],info:"普通怪物-战士型"},
5202:{uuid:5202,name:"兽人刺客",path:"mo1", fac:FacSet.MON, kind:1, 5202:{uuid:5202,name:"兽人刺客",path:"mo1", fac:FacSet.MON, kind:1,
type:HType.remote,lv:1,hp:20,mp:100,map:10,def:5,mdef:0,ap:5,dis:350,speed:150,skills:[6002], type:HType.remote,lv:1,hp:20,mp:100,map:10,def:5,mdef:0,ap:5,dis:350,speed:150,skills:[6001],
buff:[],tal:[],info:"普通怪物-战士型"}, buff:[],tal:[],info:"普通怪物-战士型"},
5203:{uuid:5203,name:"兽人护卫",path:"mo1", fac:FacSet.MON, kind:1, 5203:{uuid:5203,name:"兽人护卫",path:"mo1", fac:FacSet.MON, kind:1,
type:HType.warrior,lv:1,hp:60,mp:100,map:10,def:5,mdef:0,ap:5,dis:90,speed:100,skills:[6002], type:HType.warrior,lv:1,hp:60,mp:100,map:10,def:5,mdef:0,ap:5,dis:90,speed:100,skills:[6001],
buff:[],tal:[],info:"普通怪物-战士型"}, buff:[],tal:[],info:"普通怪物-战士型"},
// 1. 基础近战型 // 1. 基础近战型
5204:{uuid:5204,name:"蝙蝠",path:"mo1", fac:FacSet.MON, kind:1, 5204:{uuid:5204,name:"蝙蝠",path:"mo1", fac:FacSet.MON, kind:1,
type:HType.warrior,lv:1,hp:28,mp:100,map:10,def:2,mdef:0,ap:6,dis:90,speed:125,skills:[6002], type:HType.warrior,lv:1,hp:28,mp:100,map:10,def:2,mdef:0,ap:6,dis:90,speed:125,skills:[6001],
buff:[],tal:[],info:"基础近战型:直接向玩家移动,接触造成伤害;中速、低血、数量多"}, buff:[],tal:[],info:"基础近战型:直接向玩家移动,接触造成伤害;中速、低血、数量多"},
5205:{uuid:5205,name:"骷髅",path:"mo1", fac:FacSet.MON, kind:1, 5205:{uuid:5205,name:"骷髅",path:"mo1", fac:FacSet.MON, kind:1,
type:HType.warrior,lv:1,hp:35,mp:100,map:10,def:3,mdef:0,ap:7,dis:90,speed:120,skills:[6002], type:HType.warrior,lv:1,hp:35,mp:100,map:10,def:3,mdef:0,ap:7,dis:90,speed:120,skills:[6001],
buff:[],tal:[],info:"基础近战型:直接向玩家移动,接触造成伤害;中速、低血、数量多"}, buff:[],tal:[],info:"基础近战型:直接向玩家移动,接触造成伤害;中速、低血、数量多"},
// 2. 快速突击型 // 2. 快速突击型
5206:{uuid:5206,name:"石像鬼",path:"mo1", fac:FacSet.MON, kind:1, 5206:{uuid:5206,name:"石像鬼",path:"mo1", fac:FacSet.MON, kind:1,
type:HType.assassin,lv:1,hp:26,mp:100,map:10,def:3,mdef:0,ap:8,dis:120,speed:180,skills:[6002], type:HType.assassin,lv:1,hp:26,mp:100,map:10,def:3,mdef:0,ap:8,dis:120,speed:180,skills:[6001],
buff:[],tal:[],info:"快速突击型:高速直线冲锋,接触伤害;高速、低血、成群出现"}, buff:[],tal:[],info:"快速突击型:高速直线冲锋,接触伤害;高速、低血、成群出现"},
5207:{uuid:5207,name:"快速骷髅",path:"mo1", fac:FacSet.MON, kind:1, 5207:{uuid:5207,name:"快速骷髅",path:"mo1", fac:FacSet.MON, kind:1,
type:HType.assassin,lv:1,hp:22,mp:100,map:10,def:2,mdef:0,ap:7,dis:120,speed:200,skills:[6002], type:HType.assassin,lv:1,hp:22,mp:100,map:10,def:2,mdef:0,ap:7,dis:120,speed:200,skills:[6001],
buff:[],tal:[],info:"快速突击型:高速直线冲锋,接触伤害;高速、低血、成群出现"}, buff:[],tal:[],info:"快速突击型:高速直线冲锋,接触伤害;高速、低血、成群出现"},
// 3. 重型坦克型 // 3. 重型坦克型
5208:{uuid:5208,name:"大型骷髅",path:"mo1", fac:FacSet.MON, kind:1, 5208:{uuid:5208,name:"大型骷髅",path:"mo1", fac:FacSet.MON, kind:1,
type:HType.warrior,lv:1,hp:140,mp:100,map:10,def:10,mdef:0,ap:10,dis:90,speed:85,skills:[6002], type:HType.warrior,lv:1,hp:140,mp:100,map:10,def:10,mdef:0,ap:10,dis:90,speed:85,skills:[6001],
buff:[],tal:[],info:"重型坦克型:缓慢逼近,高血量,中等伤害"}, buff:[],tal:[],info:"重型坦克型:缓慢逼近,高血量,中等伤害"},
5209:{uuid:5209,name:"树人",path:"mo1", fac:FacSet.MON, kind:1, 5209:{uuid:5209,name:"树人",path:"mo1", fac:FacSet.MON, kind:1,
type:HType.warrior,lv:1,hp:160,mp:100,map:10,def:12,mdef:0,ap:12,dis:90,speed:80,skills:[6002], type:HType.warrior,lv:1,hp:160,mp:100,map:10,def:12,mdef:0,ap:12,dis:90,speed:80,skills:[6001],
buff:[],tal:[],info:"重型坦克型:缓慢逼近,高血量,中等伤害"}, buff:[],tal:[],info:"重型坦克型:缓慢逼近,高血量,中等伤害"},
// 4. 远程骚扰型 // 4. 远程骚扰型
@@ -187,12 +187,12 @@ export const HeroInfo: Record<number, heroInfo> = {
// 5. 特殊机制型 // 5. 特殊机制型
5212:{uuid:5212,name:"炸弹骷髅",path:"mo1", fac:FacSet.MON, kind:1, 5212:{uuid:5212,name:"炸弹骷髅",path:"mo1", fac:FacSet.MON, kind:1,
type:HType.assassin,lv:1,hp:30,mp:100,map:10,def:3,mdef:0,ap:25,dis:100,speed:130,skills:[6002], type:HType.assassin,lv:1,hp:30,mp:100,map:10,def:3,mdef:0,ap:25,dis:100,speed:130,skills:[6001],
buff:[],tal:[],info:"特殊机制:接近玩家后自爆造成高额伤害,需优先击杀"}, buff:[],tal:[],info:"特殊机制:接近玩家后自爆造成高额伤害,需优先击杀"},
// 6. 精英/BOSS型 // 6. 精英/BOSS型
5213:{uuid:5213,name:"亡灵领主(精英)",path:"mo1", fac:FacSet.MON, kind:1, 5213:{uuid:5213,name:"亡灵领主(精英)",path:"mo1", fac:FacSet.MON, kind:1,
type:HType.warrior,lv:3,hp:200,mp:100,map:20,def:10,mdef:5,ap:20,dis:100,speed:110,skills:[6002], type:HType.warrior,lv:3,hp:200,mp:100,map:20,def:10,mdef:5,ap:20,dis:100,speed:110,skills:[6001],
buff:[],tal:[],info:"精英/BOSS高血量与独特机制波次高潮与重要经验来源"}, buff:[],tal:[],info:"精英/BOSS高血量与独特机制波次高潮与重要经验来源"},
// 5. 特殊机制扩展 // 5. 特殊机制扩展

View File

@@ -53,7 +53,11 @@ export class HeroViewComp extends CCComp {
this.on(GameEvent.FightEnd,this.do_fight_end,this) this.on(GameEvent.FightEnd,this.do_fight_end,this)
const collider = this.node.getComponent(BoxCollider2D); const collider = this.node.getComponent(BoxCollider2D);
this.scheduleOnce(()=>{ this.scheduleOnce(()=>{
if (collider) collider.enabled = true; // 先禁 if (collider) {
collider.enabled = true; // 先禁
collider.group = this.box_group; // 设置为英雄组
}
},0.1) },0.1)
// let anm = this.node.getChildByName("anm") // let anm = this.node.getChildByName("anm")
// anm.setScale(anm.scale.x*0.8,anm.scale.y*0.8); // anm.setScale(anm.scale.x*0.8,anm.scale.y*0.8);

View File

@@ -30,7 +30,6 @@ export class SkillView extends CCComp {
sData:SDataCom=null; sData:SDataCom=null;
s_uuid:number=1001 s_uuid:number=1001
// 已命中目标追踪,防止重复伤害 // 已命中目标追踪,防止重复伤害
private hitTargets: Set<string> = new Set();
start() { start() {
this.SConf = SkillSet[this.s_uuid] this.SConf = SkillSet[this.s_uuid]
this.sData=this.ent.get(SDataCom) this.sData=this.ent.get(SDataCom)
@@ -49,24 +48,28 @@ export class SkillView extends CCComp {
} }
onBeginContact (seCol: Collider2D, oCol: Collider2D) { onBeginContact (seCol: Collider2D, oCol: Collider2D) {
const targetId = oCol.uuid; // 安全获取双方信息用于日志
if(this.hitTargets.has(targetId)) return; // 已经命中过,跳过 const casterName = this.sData.caster?.ent?.get(HeroAttrsComp)?.hero_name ?? '未知施法者';
// 记录命中目标 const casterEid = this.sData.caster?.ent?.eid ?? '未知EID';
const targetView = oCol.getComponent(HeroViewComp);
// if (!this.SConf) return; const targetName = targetView?.ent?.get(HeroAttrsComp)?.hero_name ?? '非英雄对象';
// if(this.SConf.EType!=EType.collision) return const targetEid = targetView?.ent?.eid ?? '未知EID';
if(oCol.group == seCol.group) return console.log(`[skillView] 碰撞1 [${this.sData.caster.box_group}][${casterName}][${casterEid}]的[${seCol.group}]:[${this.SConf.name}][${this.ent.eid}]碰撞了 [${oCol.group}]:[ ${targetName}][${targetEid}]`);
let target = oCol.getComponent(HeroViewComp) // 基本空值与同组过滤
if(target == null) return; if (!this.sData || !this.SConf) {
let model=target.ent.get(HeroAttrsComp) console.warn('[SkillView] onBeginContact 缺少 sData 或 SConf忽略此次碰撞');
console.log(`[skillView] 碰撞3`,oCol.group,seCol.group,model); return;
if(model == null) return }
if(model.is_dead) return if (oCol.group === seCol.group) return;
if(this.sData.fac == model.fac) return; // 不是 HeroViewComp直接忽略
// 检查是否已经命中过这个目标 if (!targetView) return;
console.log(`[skillView] 碰撞5[${this.sData.caster.box_group}][${this.sData.caster.ent.get(HeroAttrsComp).hero_name}][${this.sData.caster.ent.eid}]的[${this.group}] [${this.SConf.name}]碰撞了 [${oCol.group}][ ${oCol.getComponent(HeroViewComp).ent.get(HeroAttrsComp).hero_name}][${oCol.getComponent(HeroViewComp).ent.eid}]`); let model = targetView.ent.get(HeroAttrsComp);
this.hitTargets.add(targetId); // console.log(`[skillView] 碰撞3`, oCol.group, seCol.group, model);
this.apply_damage(target) if (!model) return;
if (model.is_dead) return;
if (this.sData.fac == model.fac) return;
// 检查是否已经命中过这个目标(日志安全输出)
this.apply_damage(targetView)
} }
onAnimationFinished(){ onAnimationFinished(){
@@ -74,70 +77,59 @@ export class SkillView extends CCComp {
this.ent.destroy() this.ent.destroy()
} }
} }
//动画帧事件 atk 触发 // //动画帧事件 atk 触发
public atk(args:any){ // public atk(args:any){
let dis=this.node.getComponent(UITransform).width/2 // let dis=this.node.getComponent(UITransform).width/2
let enemys:any=[] // let enemys:any=[]
if( this.sData.fac==FacSet.HERO){ // if( this.sData.fac==FacSet.HERO){
enemys=ecs.query(ecs.allOf(MonMoveComp)) // enemys=ecs.query(ecs.allOf(MonMoveComp))
}else{ // }else{
enemys=ecs.query(ecs.allOf(HeroMoveComp)) // enemys=ecs.query(ecs.allOf(HeroMoveComp))
} // }
let IRTargets: HeroViewComp[] = [] // let IRTargets: HeroViewComp[] = []
// 收集范围内所有敌方目标 // // 收集范围内所有敌方目标
enemys.some(e => { // enemys.some(e => {
const view = e.get(HeroViewComp); // const view = e.get(HeroViewComp);
const model=e.get(HeroAttrsComp) // const model=e.get(HeroAttrsComp)
const distance = Math.abs(this.node.position.x - view.node.position.x); // const distance = Math.abs(this.node.position.x - view.node.position.x);
if(distance <= dis&&!model.is_dead) { // if(distance <= dis&&!model.is_dead) {
IRTargets.push(view); // IRTargets.push(view);
} // }
}); // });
// 根据配置的hit_num决定攻击模式 // // 根据配置的hit_num决定攻击模式
const hitNum = SkillSet[this.s_uuid].hit_num || 0; // const hitNum = SkillSet[this.s_uuid].hit_num || 0;
if(hitNum > 0) { // if(hitNum > 0) {
// 限制目标数量按距离排序选择最近的N个目标 // // 限制目标数量按距离排序选择最近的N个目标
if(IRTargets.length > 0) { // if(IRTargets.length > 0) {
// 按距离排序(从近到远) // // 按距离排序(从近到远)
IRTargets.sort((a, b) => { // IRTargets.sort((a, b) => {
const distanceA = Math.abs(this.node.position.x - a.node.position.x); // const distanceA = Math.abs(this.node.position.x - a.node.position.x);
const distanceB = Math.abs(this.node.position.x - b.node.position.x); // const distanceB = Math.abs(this.node.position.x - b.node.position.x);
return distanceA - distanceB; // return distanceA - distanceB;
}); // });
// 限制目标数量 // // 限制目标数量
const maxTargets = Math.min(hitNum, IRTargets.length); // const maxTargets = Math.min(hitNum, IRTargets.length);
const sTargets = IRTargets.slice(0, maxTargets); // const sTargets = IRTargets.slice(0, maxTargets);
sTargets.forEach(target => { // sTargets.forEach(target => {
this.apply_damage(target, false); // this.apply_damage(target, false);
}); // });
} // }
} else { // } else {
// 范围伤害:对所有范围内目标造成伤害 // // 范围伤害:对所有范围内目标造成伤害
if(IRTargets.length > 0) { // if(IRTargets.length > 0) {
IRTargets.forEach(target => { // IRTargets.forEach(target => {
this.apply_damage(target, true); // this.apply_damage(target, true);
}); // });
} // }
} // }
} // }
//伤害应用 //伤害应用
apply_damage(target:HeroViewComp,is_range:boolean=false){ apply_damage(target:HeroViewComp,is_range:boolean=false){
if(target == null) return; if(target == null) return;
if (!this.SConf) return; if (!this.SConf) return;
// 检查是否已经命中过这个目标(除非是范围伤害) // console.log(`[skillView] 伤害 [${this.group}][${this.sData.caster.ent.get(HeroAttrsComp).hero_name}][${this.sData.caster.ent.eid}]的 [${this.SConf.name}]对 [${target.box_group}][ ${target.ent.get(HeroAttrsComp).hero_name}][${target.ent.eid}]`);
const targetId = target.node.uuid;
if(!is_range && this.hitTargets.has(targetId)) {
return; // 已经命中过,跳过
}
// 记录命中目标(除非是范围伤害)
if(!is_range) {
this.hitTargets.add(targetId);
}
console.log(`[skillView] 伤害 [${this.group}][${this.sData.caster.ent.get(HeroAttrsComp).hero_name}][${this.sData.caster.ent.eid}]的 [${this.SConf.name}]对 [${target.box_group}][ ${target.ent.get(HeroAttrsComp).hero_name}][${target.ent.eid}]`);
// if(this.sData.hit_count > this.SConf.hit_num) return 不能超出 最大伤害数量 // if(this.sData.hit_count > this.SConf.hit_num) return 不能超出 最大伤害数量
// 使用伤害队列系统处理伤害 // 使用伤害队列系统处理伤害
DamageQueueHelper.addDamageToEntity( DamageQueueHelper.addDamageToEntity(
@@ -149,10 +141,21 @@ export class SkillView extends CCComp {
// 更新技能命中次数 // 更新技能命中次数
this.sData.hit_count++ this.sData.hit_count++
// 检查技能是否应该销毁 // 检查技能是否应该销毁
if( this.sData.hit_count>=(this.SConf.hit+ this.sData.Attrs[Attrs.PUNCTURE])&&(this.SConf.DTType!=DTType.range)&&(this.SConf.EType!=EType.animationEnd)&&(this.SConf.EType!=EType.timeEnd)) this.ent.destroy// 技能命中次数 if (
this.sData.hit_count >= (this.SConf.hit + this.sData.Attrs[Attrs.PUNCTURE]) &&
(this.SConf.DTType != DTType.range) &&
(this.SConf.EType != EType.animationEnd) &&
(this.SConf.EType != EType.timeEnd)
) {
this.ent.destroy(); // 技能命中次数达到上限后销毁
}
} }
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */ /** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
reset() { reset() {
const collider = this.getComponent(Collider2D);
if (collider) {
collider.off(Contact2DType.BEGIN_CONTACT);
}
this.node.destroy(); this.node.destroy();
} }
} }

View File

@@ -19,8 +19,7 @@
"designResolution": { "designResolution": {
"width": 720, "width": 720,
"height": 1280 "height": 1280
}, }
"downloadMaxConcurrency": 30
}, },
"fbx": { "fbx": {
"legacyFbxImporter": { "legacyFbxImporter": {
@@ -40,12 +39,12 @@
} }
], ],
"collisionMatrix": { "collisionMatrix": {
"0": 64, "0": 96,
"1": 20, "1": 52,
"2": 74, "2": 74,
"3": 36, "3": 36,
"4": 66, "4": 66,
"5": 8, "5": 11,
"6": 21 "6": 21
}, },
"gravity": { "gravity": {