This commit is contained in:
2025-05-26 23:20:17 +08:00
parent 3efbf21a14
commit 424edb89a7
2 changed files with 10 additions and 9 deletions

View File

@@ -91,7 +91,7 @@
"__id__": 11 "__id__": 11
} }
], ],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 19 "__id__": 19
@@ -121,7 +121,7 @@
}, },
"_lscale": { "_lscale": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0.7, "x": 0.9,
"y": 1, "y": 1,
"z": 1 "z": 1
}, },
@@ -741,7 +741,7 @@
"__id__": 39 "__id__": 39
} }
], ],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 45 "__id__": 45
@@ -752,8 +752,8 @@
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0, "x": -23.841,
"y": -12.854, "y": -33.63,
"z": 0 "z": 0
}, },
"_lrot": { "_lrot": {
@@ -765,8 +765,8 @@
}, },
"_lscale": { "_lscale": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0.8, "x": 1.2,
"y": 0.8, "y": 1.2,
"z": 1 "z": 1
}, },
"_mobility": 0, "_mobility": 0,

View File

@@ -32,6 +32,7 @@ export class BuffComp extends Component {
wind_cd:number=0; wind_cd:number=0;
speek_time:number=0; speek_time:number=0;
start() { start() {
this.info_init() this.info_init()
} }
@@ -60,8 +61,10 @@ export class BuffComp extends Component {
} }
hp_show(){ hp_show(){
if(this.node.getComponent(HeroViewComp).fac == 0) { if(this.node.getComponent(HeroViewComp).fac == 0) {
this.top_node.getChildByName("hp").active = false;
this.update_info_hp() this.update_info_hp()
}else{ }else{
this.top_node.getChildByName("lv").active = true;
let hp=this.node.getComponent(HeroViewComp).hp; let hp=this.node.getComponent(HeroViewComp).hp;
let hp_max=this.node.getComponent(HeroViewComp).hp_max; let hp_max=this.node.getComponent(HeroViewComp).hp_max;
let hp_progress= hp/hp_max; let hp_progress= hp/hp_max;
@@ -79,8 +82,6 @@ export class BuffComp extends Component {
update_info_hp(){ update_info_hp(){
let ihp_node = this.top_node.getChildByName("ihp"); let ihp_node = this.top_node.getChildByName("ihp");
ihp_node.getChildByName("num").getComponent(Label)!.string = this.node.getComponent(HeroViewComp).hp.toFixed(0) ihp_node.getChildByName("num").getComponent(Label)!.string = this.node.getComponent(HeroViewComp).hp.toFixed(0)
this.hp_show()
} }
update_info_ap(){ update_info_ap(){