This commit is contained in:
2025-04-24 10:51:37 +08:00
parent 02547cb470
commit 28b557f18f

View File

@@ -55,7 +55,7 @@ export class MissionHeroCompComp extends CCComp {
console.log("call_hero addHero",uuid)
let info:any={ap:0,hp:0}
if(this.start_pos[HeroInfo[uuid].type].has){
info=this.remove_hero(HeroInfo[uuid].type)
info=this.her_remove_and_get_info(HeroInfo[uuid].type)
}
let hero = ecs.getEntity<Hero>(Hero);
let scale = 1
@@ -64,7 +64,7 @@ export class MissionHeroCompComp extends CCComp {
hero.load(pos,scale,uuid,info);
this.start_pos[HeroInfo[uuid].type].has=true
}
remove_hero(type:number){
her_remove_and_get_info(type:number){
let info:any={ap:0,hp:0}
let heros=ecs.query(ecs.allOf(HeroModelComp))
for(let hero of heros){