物品图标
This commit is contained in:
@@ -70,7 +70,7 @@ export class MonsterViewComp extends CCComp {
|
||||
stop_cd: number = 0.5; /*停止倒计时*/
|
||||
|
||||
shield:number = 0; //护盾量
|
||||
shield_max:number = 0;
|
||||
shield_max:number = 200;
|
||||
shield_time:number = 0; //护盾持续时间
|
||||
|
||||
box_group:number = 2;
|
||||
@@ -222,13 +222,14 @@ export class MonsterViewComp extends CCComp {
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
let shield_progress= this.shield/this.shield_max;
|
||||
this.node.getChildByName("shield").getComponent(ProgressBar)!.progress = shield_progress;
|
||||
// if(this.shield <= 0){
|
||||
// this.node.getChildByName("shield").active=false
|
||||
// }else{
|
||||
// this.node.getChildByName("shield").active=true
|
||||
|
||||
// }
|
||||
}
|
||||
hp_change(hp: number){
|
||||
if(this.is_dead){
|
||||
@@ -253,6 +254,10 @@ export class MonsterViewComp extends CCComp {
|
||||
}, 15);
|
||||
}
|
||||
}
|
||||
add_hp(hp: number=0){
|
||||
console.log("hero 加血动画");
|
||||
this.tooltip(2,"+"+hp.toString());
|
||||
}
|
||||
shield_change(hp: number){
|
||||
let ls=this.shield - hp;
|
||||
if(ls <= 0){
|
||||
|
||||
Reference in New Issue
Block a user