dd
This commit is contained in:
@@ -20,6 +20,7 @@ export class HCardComp extends CCComp {
|
||||
hp:any=[]
|
||||
life:any=[]
|
||||
pw:any=[]
|
||||
is_dead:boolean=false
|
||||
protected onLoad(): void {
|
||||
|
||||
|
||||
@@ -36,11 +37,21 @@ export class HCardComp extends CCComp {
|
||||
console.log("hcard start")
|
||||
}
|
||||
protected update(dt: number): void {
|
||||
if(this.is_dead) return
|
||||
if(this.heros[this.hi].HeroView.is_dead){
|
||||
this.node.getChildByName("dead").active=true
|
||||
this.node.getChildByName("bg").getComponent(Sprite).grayscale=true
|
||||
this.is_dead=true
|
||||
}else{
|
||||
this.node.getChildByName("dead").active=false
|
||||
this.node.getChildByName("bg").getComponent(Sprite).grayscale=false
|
||||
this.is_dead=false
|
||||
}
|
||||
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) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
reset() {
|
||||
|
||||
Reference in New Issue
Block a user