fix(英雄属性): 修复回血时未正确触发视图层特效的问题

调整 HeroAttrsSystem 中 HP 自然回复的逻辑,当回血值大于零时,通过 HeroViewComp 触发对应的视图层特效。同时,在 HeroAttrsComp 的注释中补充了触发视图层的条件说明,以保持数据层与视图层的分离。
This commit is contained in:
panw
2026-02-04 15:11:41 +08:00
parent 0e63060957
commit 576c3ebbd5
2 changed files with 24 additions and 3 deletions

View File

@@ -249,7 +249,7 @@ export class HeroAttrsComp extends ecs.Comp {
// ✅ 数据层只负责数据修改,不调用视图层
// let heroView = this.ent.get(HeroViewComp);
// if(heroView){
// if(heroView && addValue > 0){
// heroView.health(addValue);
// }