From ff4ce764826d25fadaabfe72588f808abc7ae68b Mon Sep 17 00:00:00 2001 From: panw Date: Thu, 20 Nov 2025 15:19:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=8A=80=E8=83=BD?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E5=BC=95=E7=94=A8=E9=97=AE=E9=A2=98=E5=B9=B6?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=97=A0=E7=94=A8=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在Skill.ts中修改Attrs为浅拷贝避免引用问题 - 移除HeroAtk.ts中未使用的casterModel变量 --- assets/script/game/hero/HeroAtk.ts | 2 -- assets/script/game/skill/Skill.ts | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/assets/script/game/hero/HeroAtk.ts b/assets/script/game/hero/HeroAtk.ts index 69a6d640..b92b7a30 100644 --- a/assets/script/game/hero/HeroAtk.ts +++ b/assets/script/game/hero/HeroAtk.ts @@ -105,8 +105,6 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpd // 获取攻击者数据 const caster = damageEvent.caster; - const casterModel = caster.ent.get(HeroAttrsComp); - if (!casterModel) return reDate; // 获取技能配置 const skillConf = SkillSet[damageEvent.s_uuid]; diff --git a/assets/script/game/skill/Skill.ts b/assets/script/game/skill/Skill.ts index 2b9f5c4e..7e83fcca 100644 --- a/assets/script/game/skill/Skill.ts +++ b/assets/script/game/skill/Skill.ts @@ -90,7 +90,7 @@ export class Skill extends ecs.Entity { const sDataCom = this.get(SDataCom); sDataCom.group=caster.box_group sDataCom.caster=caster - sDataCom.Attrs=cAttrsComp.Attrs + sDataCom.Attrs={...cAttrsComp.Attrs} sDataCom.s_uuid=s_uuid sDataCom.fac=cAttrsComp.fac }