dd
This commit is contained in:
@@ -87,6 +87,7 @@ export class MonsterViewComp extends CCComp {
|
||||
} /** 视图层逻辑代码分离演示 */
|
||||
start () {
|
||||
this.sprite = this.node.getChildByName("avatar").getChildByName("TNode").getChildByName("bb").getComponent(Sprite);
|
||||
this.node.getChildByName("top").setScale(this.scale,1);
|
||||
this.orginalFlashMaterial = this.sprite.getRenderMaterial(0);
|
||||
|
||||
this.BoxRang.getComponent(BoxRangComp).box_group = this.box_group;
|
||||
@@ -180,7 +181,7 @@ export class MonsterViewComp extends CCComp {
|
||||
this.power = 0
|
||||
}
|
||||
let power_progress= this.power/this.power_max;
|
||||
this.node.getChildByName("power").getComponent(ProgressBar)!.progress = power_progress;
|
||||
this.node.getChildByName("top").getChildByName("power").getComponent(ProgressBar)!.progress = power_progress;
|
||||
}
|
||||
shoot(skill_uuid:number){
|
||||
// console.log("monster shoot");
|
||||
@@ -223,7 +224,7 @@ export class MonsterViewComp extends CCComp {
|
||||
}
|
||||
in_shield(){
|
||||
let shield_progress= this.shield/this.shield_max;
|
||||
this.node.getChildByName("shield").getComponent(ProgressBar)!.progress = shield_progress;
|
||||
this.node.getChildByName("top").getChildByName("shield").getComponent(ProgressBar)!.progress = shield_progress;
|
||||
// if(this.shield <= 0){
|
||||
// this.node.getChildByName("shield").active=false
|
||||
// }else{
|
||||
@@ -245,7 +246,7 @@ export class MonsterViewComp extends CCComp {
|
||||
this.hp = this.hp_max;
|
||||
}
|
||||
let hp_progress= this.hp/this.hp_max;
|
||||
this.node.getChildByName("hp").getComponent(ProgressBar)!.progress = hp_progress;
|
||||
this.node.getChildByName("top").getChildByName("hp").getComponent(ProgressBar)!.progress = hp_progress;
|
||||
if(this.hp <= 0){
|
||||
this.dead();
|
||||
this.is_dead = true;
|
||||
|
||||
Reference in New Issue
Block a user