死亡计数出错修复 + 刷怪5个后间隔5秒

This commit is contained in:
2025-07-31 17:22:04 +08:00
parent d56b4293d7
commit 7bb49f86d5
7 changed files with 50 additions and 9 deletions

View File

@@ -42,7 +42,7 @@ export class BuffComp extends Component {
info_init(){
this.HeroView=this.node.getComponent(HeroViewComp)
this.top_node = this.node.getChildByName("top");
let hp_y=this.node.getComponent(UITransform).height+20
let hp_y=this.node.getComponent(UITransform).height
this.top_node.setPosition(0,hp_y,0)
this.hp_bar=this.top_node.getChildByName("hp").getComponent(ProgressBar)
// this.top_node.getChildByName("hp").active=(this.node.getComponent(HeroViewComp).fac == 1 ? true : false)
@@ -228,7 +228,7 @@ export class BuffComp extends Component {
hp_tip(type:number=1,value:string="",s_uuid:number=1001,y:number=90){
let tip =ecs.getEntity<Tooltip>(Tooltip);
let x=this.node.position.x;
let ny=this.node.getComponent(UITransform).height-20;
let ny=this.node.getComponent(UITransform).height+20;
let pos = v3(x,ny,0);
tip.load(pos,type,value,s_uuid,this.node.parent);
}

View File

@@ -39,6 +39,7 @@ export class HeroViewComp extends CCComp {
box_group:number = BoxSet.HERO;
is_dead:boolean = false; //是否摧毁
is_count_dead:boolean = false; //是否计数死亡
is_stop:boolean = false;
is_atking:boolean = false;
@@ -446,7 +447,12 @@ export class HeroViewComp extends CCComp {
//console.log("[HeroViewComp]:角色死亡",this.hero_uuid)
if(this.fac==FacSet.MON){
oops.message.dispatchEvent(GameEvent.MonDead)
if(this.is_count_dead) return
this.is_count_dead=true
this.scheduleOnce(()=>{
oops.message.dispatchEvent(GameEvent.MonDead)
},0.1)
}
if(this.fac==FacSet.HERO){