This commit is contained in:
2025-05-23 10:25:40 +08:00
parent da1124a065
commit 9b97bff159
2 changed files with 3061 additions and 1753 deletions

View File

@@ -30,6 +30,7 @@ export class MissionHeroCompComp extends CCComp {
}
start() {
// this.test_call()
this.node.getChildByName("location").active=false
}
protected update(dt: number): void {
if(smc.mission.status != 1) return
@@ -47,21 +48,21 @@ export class MissionHeroCompComp extends CCComp {
console.log("show_heros_pos",args)
this.current_hero_uuid=args.uuid
this.update_fight_hero_info()
this.node.getChildByName("herospos").active=true
this.node.getChildByName("location").active=true
}
update_fight_hero_info(){
let heros=ecs.query(ecs.allOf(HeroModelComp))
for(let hero of heros){
let hv = hero.get(HeroViewComp)
if(hv.fight_pos==0){
let icon=this.node.getChildByName("herospos").getChildByName("heropos1").getChildByName("hero").getChildByName("icon")
let icon=this.node.getChildByName("location").getChildByName("herospos").getChildByName("heropos1").getChildByName("hero").getChildByName("icon")
let icon_frame=oops.res.get(HeroInfo[hv.hero_uuid].icon,SpriteFrame)!
icon.getComponent(Sprite).spriteFrame=icon_frame
}
}
}
call_hero(event: string, args: any){
this.node.getChildByName("herospos").active=false
this.node.getChildByName("location").active=false
console.log("call_hero",args)
let fight_pos=args
this.timer.reset()