fix: 修正技能类型并添加碰撞组件

- 将m_water_ball_1.prefab的_type从1改为0
- 在SACastSystem.ts中修复目标返回逻辑
- 为atk_s1.prefab添加RigidBody2D和BoxCollider2D组件
This commit is contained in:
2025-11-02 00:23:53 +08:00
parent 8fdd9e2c98
commit b24f0e2afc
3 changed files with 78 additions and 4 deletions

View File

@@ -32,10 +32,16 @@
}, },
{ {
"__id__": 16 "__id__": 16
},
{
"__id__": 18
},
{
"__id__": 20
} }
], ],
"_prefab": { "_prefab": {
"__id__": 18 "__id__": 22
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@@ -356,6 +362,74 @@
"__type__": "cc.CompPrefabInfo", "__type__": "cc.CompPrefabInfo",
"fileId": "35nW0iQNBH2bqkWAr3MVkQ" "fileId": "35nW0iQNBH2bqkWAr3MVkQ"
}, },
{
"__type__": "cc.RigidBody2D",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 19
},
"enabledContactListener": true,
"bullet": false,
"awakeOnLoad": true,
"_group": 1,
"_type": 0,
"_allowSleep": false,
"_gravityScale": 1,
"_linearDamping": 0,
"_angularDamping": 0,
"_linearVelocity": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_angularVelocity": 0,
"_fixedRotation": false,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "57cr7S0YpK4oEZCavwXtIX"
},
{
"__type__": "cc.BoxCollider2D",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": false,
"__prefab": {
"__id__": 21
},
"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": 50,
"height": 50
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "ebw5mObxNGGKxnJXDgX5gl"
},
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
"root": { "root": {

View File

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

View File

@@ -166,8 +166,8 @@ export class SACastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdat
// 这里可以调用 SkillConComp 的目标选择逻辑 // 这里可以调用 SkillConComp 的目标选择逻辑
// 暂时返回默认位置 // 暂时返回默认位置
if (caster==null ) return if (caster == null) return targets;
if(caster.ent == null) return if (caster.ent == null) return targets;
const heroAttrs = caster.ent.get(HeroAttrsComp); const heroAttrs = caster.ent.get(HeroAttrsComp);
const fac = heroAttrs?.fac ?? 0; const fac = heroAttrs?.fac ?? 0;
const defaultX = fac === 0 ? 400 : -400; const defaultX = fac === 0 ? 400 : -400;