技能碰撞改回物理碰撞

This commit is contained in:
2025-03-31 08:16:41 +08:00
parent 798a831227
commit 063764dc82
5 changed files with 59 additions and 38 deletions

View File

@@ -33,8 +33,14 @@ export class HeroInfoCompComp extends CCComp {
this.update_info()
}
update_info(){
let heros=ecs.query(ecs.allOf(HeroModelComp))
for(let hero of heros){
let heros=ecs.query(ecs.allOf(HeroModelComp))
this.has_hero=false
this.node.getChildByName("info").getChildByName("ap").getChildByName("num").getComponent(Label).string=""
this.node.getChildByName("info").getChildByName("hp").getChildByName("num").getComponent(Label).string=""
this.node.getChildByName("name").getComponent(Label).string="无英雄"
const sprite = this.node.getChildByName("mask").getChildByName("icon").getComponent(Sprite);
// sprite.spriteFrame = //需要添加默认头像
for(let hero of heros){
let info=hero.get(HeroViewComp)
if(info.node.position.x==HeroPos[this.c_id].pos.x){
this.has_hero=true
@@ -47,11 +53,11 @@ export class HeroInfoCompComp extends CCComp {
sprite.spriteFrame = atlas.getSpriteFrame(HeroInfo[info.hero_uuid].path);
});
}
}
if(this.is_Change){
this.node.getChildByName("change").active=this.has_hero
this.node.getChildByName("select").active=!this.has_hero
}
}
// if(this.is_Change){
// this.node.getChildByName("change").active=this.has_hero
// this.node.getChildByName("select").active=!this.has_hero
// }
}
/** 全局消息逻辑处理 */
// private onHandler(event: string, args: any) {