buff 优化 heroset 不再使用json
This commit is contained in:
@@ -154,6 +154,7 @@ export class MonsterViewComp extends CCComp {
|
||||
this.power_change(this.power_speed)
|
||||
}
|
||||
this.in_destroy();
|
||||
this.in_shield();
|
||||
this.in_stop(dt);
|
||||
this.in_act(dt);
|
||||
this.move(dt);
|
||||
@@ -220,6 +221,15 @@ export class MonsterViewComp extends CCComp {
|
||||
this.atk_time += dt;
|
||||
}
|
||||
}
|
||||
in_shield(){
|
||||
if(this.shield <= 0){
|
||||
this.node.getChildByName("shield").active=false
|
||||
}else{
|
||||
this.node.getChildByName("shield").active=true
|
||||
let shield_progress= this.shield/this.shield_max;
|
||||
this.node.getChildByName("shield").getComponent(ProgressBar)!.progress = shield_progress;
|
||||
}
|
||||
}
|
||||
hp_change(hp: number){
|
||||
if(this.is_dead){
|
||||
return;
|
||||
@@ -252,8 +262,6 @@ export class MonsterViewComp extends CCComp {
|
||||
this.shield = ls;
|
||||
return 0;
|
||||
}
|
||||
// let shield_progress= this.shield/this.shield_max;
|
||||
// this.node.getChildByName("shield").getComponent(ProgressBar)!.progress = shield_progress;
|
||||
}
|
||||
tooltip(type:number=1,value:string="",s_uuid:number=1001){
|
||||
// console.log("tooltip",type);
|
||||
|
||||
Reference in New Issue
Block a user