From 0b85345369c0e7d1ef050c170e73fc1bbe5d3725 Mon Sep 17 00:00:00 2001 From: walkpan Date: Sun, 15 Mar 2026 22:00:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E4=B8=AD=E8=BF=87=E8=BF=91=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E5=BF=BD=E7=95=A5=E6=95=8C=E5=AF=B9=E9=98=B5=E8=90=A5=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 调整hasAnyActorTooClose方法,在判断其他角色是否过近时,增加阵营校验逻辑,确保只检测同阵营角色,避免误判敌对角色位置。 --- assets/resources/game/skill/atk/atk_f2.prefab | 5 +++-- assets/script/game/hero/MoveComp.ts | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/assets/resources/game/skill/atk/atk_f2.prefab b/assets/resources/game/skill/atk/atk_f2.prefab index 0c80d4cd..3e0a3e49 100644 --- a/assets/resources/game/skill/atk/atk_f2.prefab +++ b/assets/resources/game/skill/atk/atk_f2.prefab @@ -111,8 +111,8 @@ }, "_lscale": { "__type__": "cc.Vec3", - "x": 1.8, - "y": -1.6, + "x": 2, + "y": -1, "z": 1 }, "_mobility": 0, @@ -460,6 +460,7 @@ }, "atk_x": 0, "atk_y": 0, + "debugMode": true, "_id": "" }, { diff --git a/assets/script/game/hero/MoveComp.ts b/assets/script/game/hero/MoveComp.ts index deeb1736..29333053 100644 --- a/assets/script/game/hero/MoveComp.ts +++ b/assets/script/game/hero/MoveComp.ts @@ -289,10 +289,13 @@ export class MoveSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate } private hasAnyActorTooClose(self: ecs.Entity, x: number, y: number): boolean { + const myAttrs = self.get(HeroAttrsComp); + if (!myAttrs) return false; return ecs.query(ecs.allOf(HeroAttrsComp, HeroViewComp)).some(e => { if (e === self) return false; const attrs = e.get(HeroAttrsComp); if (!attrs || attrs.is_dead) return false; + if (attrs.fac !== myAttrs.fac) return false; const view = e.get(HeroViewComp); if (!view || !view.node) return false; return Math.abs(view.node.position.x - x) < this.minSpacingX