hero 界面调整 局内英雄不再升级,改为升级局内技能

This commit is contained in:
pan@work
2024-11-19 15:15:05 +08:00
parent e89f590979
commit e6f4a8085b
10 changed files with 188 additions and 151 deletions

View File

@@ -19,6 +19,7 @@ export class HCardComp extends CCComp {
ap:any=[]
hp:any=[]
life:any=[]
pw:any=[]
protected onLoad(): void {
@@ -26,10 +27,11 @@ export class HCardComp extends CCComp {
start() {
this.heros= ecs.query(ecs.allOf(HeroModelComp));
this.hc_name=this.node.getChildByName("name").getComponent(Label)!
this.icon=this.node.getChildByName("icon").getComponent(Sprite)!
// this.icon=this.node.getChildByName("icon").getComponent(Sprite)!
this.hp=this.node.getChildByName("hp").getChildByName("num").getComponent(Label)!
this.ap=this.node.getChildByName("ap").getChildByName("num").getComponent(Label)!
this.life=this.node.getChildByName("life").getComponent(ProgressBar)!
this.life=this.node.getChildByName("life").getComponent(ProgressBar)!
this.pw=this.node.getChildByName("pow").getComponent(ProgressBar)!
this.hc_name.string= this.heros[this.hi].HeroView.hero_name
console.log("hcard start")
}
@@ -37,6 +39,7 @@ export class HCardComp extends CCComp {
this.hp.string=this.heros[this.hi].HeroView.hp_max
this.ap.string=this.heros[this.hi].HeroView.ap
this.life.progress=this.heros[this.hi].HeroView.hp/this.heros[this.hi].HeroView.hp_max
this.pw.progress=this.heros[this.hi].HeroView.pw/this.heros[this.hi].HeroView.pwm
}
/** 视图对象通过 ecs.Entity.remove(ControllerComp) 删除组件是触发组件处理自定义释放逻辑 */