feat: 实现战斗准备阶段英雄复活与入场动画

在准备阶段开始时,通过 PhasePrepareStart 事件触发英雄状态重置:
- 死亡英雄复活并恢复满血,播放下落入场动画
- 英雄实体在死亡时移至墓地并禁用碰撞,避免战斗逻辑干扰
- 更新英雄数量UI以反映复活后的状态
This commit is contained in:
panw
2026-04-22 17:05:34 +08:00
parent e230feab14
commit a65a26b0bc
5 changed files with 81 additions and 24 deletions

View File

@@ -392,6 +392,7 @@ export class HeroViewComp extends CCComp {
this.model.is_dead=false
this.model.is_count_dead=false
this.deadCD = 0;
this.as.do_buff();
this.status_change("idle");
this.model.hp =this.model.hp_max*50/100;
@@ -448,17 +449,24 @@ export class HeroViewComp extends CCComp {
}
if(this.model.fac === FacSet.HERO){
// 将英雄移到玩家看不到的墓地
this.node.setPosition(v3(-2000, -2000, 0));
const collider = this.node.getComponent(Collider2D);
if (collider) {
collider.enabled = false;
}
// 隐藏UI
this.top_node.active = false;
} else {
// 🔥 方案B治理性措施 - 在销毁实体前先禁用碰撞体,从源头减少"尸体"参与碰撞
const collider = this.node.getComponent(Collider2D);
if (collider) {
collider.enabled = false;
}
this.ent.destroy();
}
// 🔥 方案B治理性措施 - 在销毁实体前先禁用碰撞体,从源头减少"尸体"参与碰撞
const collider = this.getComponent(Collider2D);
if (collider) {
collider.enabled = false;
}
this.ent.destroy();
}
do_atked(damage:number,isCrit:boolean,s_uuid:number,isBack:boolean=false){
// 受到攻击时更新最后更新时间