From ba3e416ab0b53e8d087e1865fde84c235df8d697 Mon Sep 17 00:00:00 2001 From: walkpan Date: Wed, 15 Apr 2026 20:48:07 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8A=80=E8=83=BD=E8=A7=A6=E5=8F=91):=20?= =?UTF-8?q?=E5=B0=86call=E6=8A=80=E8=83=BD=E8=A7=A6=E5=8F=91=E6=97=B6?= =?UTF-8?q?=E6=9C=BA=E4=BB=8E=E5=85=A5=E5=9C=BA=E6=97=B6=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E8=90=BD=E5=9C=B0=E5=90=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 确保英雄和怪物在完全落地并设置好碰撞组后再触发call技能,避免潜在的时序问题 --- assets/script/game/hero/Hero.ts | 24 ++++++++++++------------ assets/script/game/hero/Mon.ts | 24 ++++++++++++------------ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/assets/script/game/hero/Hero.ts b/assets/script/game/hero/Hero.ts index d1e98856..ccae4c84 100644 --- a/assets/script/game/hero/Hero.ts +++ b/assets/script/game/hero/Hero.ts @@ -143,18 +143,6 @@ export class Hero extends ecs.Entity { move.moving = false; hv.as.idle(); - // 触发 call 技能 - if (hero.call && hero.call.length > 0) { - hero.call.forEach(uuid => { - oops.message.dispatchEvent(GameEvent.TriggerSkill, { - s_uuid: uuid, - heroAttrs: model, - heroView: hv, - triggerType: 'call' - }); - }); - } - // 依据下落距离自适应入场时长,保证手感稳定 const dropDistance = Math.abs(pos.y - dropToY); const dropDuration = Math.max(0.18, Math.min(0.38, dropDistance / 1200)); @@ -175,6 +163,18 @@ export class Hero extends ecs.Entity { collider.group = BoxSet.HERO; collider.apply(); } + + // 落地后触发 call 技能 + if (hero.call && hero.call.length > 0) { + hero.call.forEach(uuid => { + oops.message.dispatchEvent(GameEvent.TriggerSkill, { + s_uuid: uuid, + heroAttrs: model, + heroView: hv, + triggerType: 'call' + }); + }); + } }) .start(); } diff --git a/assets/script/game/hero/Mon.ts b/assets/script/game/hero/Mon.ts index cfa5ec28..1280aefa 100644 --- a/assets/script/game/hero/Mon.ts +++ b/assets/script/game/hero/Mon.ts @@ -197,18 +197,6 @@ export class Monster extends ecs.Entity { move.baseY = dropToY; move.moving = false; - // 触发 call 技能 - if (hero.call && hero.call.length > 0) { - hero.call.forEach((uuid: number) => { - oops.message.dispatchEvent(GameEvent.TriggerSkill, { - s_uuid: uuid, - heroAttrs: model, - heroView: view, - triggerType: 'call' - }); - }); - } - // 依据下落距离自适应入场时长,确保观感一致 const dropDistance = Math.abs(pos.y - dropToY); const dropDuration = Math.max(0.18, Math.min(0.38, dropDistance / 1200)); @@ -229,6 +217,18 @@ export class Monster extends ecs.Entity { collider.group = BoxSet.MONSTER; collider.apply(); } + + // 落地后触发 call 技能 + if (hero.call && hero.call.length > 0) { + hero.call.forEach((uuid: number) => { + oops.message.dispatchEvent(GameEvent.TriggerSkill, { + s_uuid: uuid, + heroAttrs: model, + heroView: view, + triggerType: 'call' + }); + }); + } }) .start(); // 维护关卡内怪物数量统计