添加了结束战斗按钮

This commit is contained in:
2024-11-13 23:36:34 +08:00
parent 9d0ee7e7b5
commit 2a07f4718a
7 changed files with 966 additions and 383 deletions

View File

@@ -122,7 +122,7 @@ export class HeroViewComp extends CCComp {
this.sprite = this.node.getChildByName("anm").getComponent(Sprite);
this.orginalFlashMaterial = this.sprite.getRenderMaterial(0);
// this.node.getChildByName("top").getChildByName("shield").active = false;
// this.node.getChildByName("shielded").active = false;
// this.node.getChildByName("top").setScale(this.scale,1);
// this.node.getChildByName("atk").setScale(this.scale,1);
// this.node.getChildByName("atk").getComponent(Label).string = this.atk.toString();
@@ -160,6 +160,10 @@ export class HeroViewComp extends CCComp {
}
if(this.shield > 0){
this.shield -= 1
if(this.shield <= 0){
this.shield = 0
this.node.getChildByName("shielded").active = false
}
return
}
let dodge = RandomManager.instance.getRandomInt(0,100,3)
@@ -576,10 +580,13 @@ export class HeroViewComp extends CCComp {
// this.node.getChildByName("top").getChildByName("buff").getChildByName(icon).active=value
}
add_shield(shield:number){
this.shield =shield
if(this.shield > 0){
this.node.getChildByName("shielded").active=true
}
}
tooltip(type:number=1,value:string="",s_uuid:number=1001,y:number=60){