fix: 调整英雄顶部UI位置和尺寸

- 将ha1.prefab中顶部节点的Y坐标从90.171改为80
- HeroViewComp中顶部节点位置不再随等级变化,固定为Y=80
- 始终显示顶部血条,不再根据血量条件隐藏
- 调整top.prefab中多个UI元素的位置和尺寸,包括血条长度从50改为40,容器宽度从173改为140
This commit is contained in:
panw
2026-04-01 10:26:57 +08:00
parent 38f0863583
commit b013086567
3 changed files with 8 additions and 8 deletions

View File

@@ -560,7 +560,7 @@
"value": {
"__type__": "cc.Vec3",
"x": 0,
"y": 90.171,
"y": 80,
"z": 0
}
},

View File

@@ -817,7 +817,7 @@
},
"_lpos": {
"__type__": "cc.Vec3",
"x": -25,
"x": -20,
"y": 0,
"z": 0
},
@@ -858,7 +858,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 50,
"width": 40,
"height": 10
},
"_anchorPoint": {
@@ -1036,7 +1036,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 173.33333333333334,
"width": 140,
"height": 40
},
"_anchorPoint": {
@@ -1161,7 +1161,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 50,
"width": 40,
"height": 10
},
"_anchorPoint": {
@@ -1239,7 +1239,7 @@
"__id__": 36
},
"_mode": 0,
"_totalLength": 50,
"_totalLength": 40,
"_progress": 1,
"_reverse": false,
"_id": ""

View File

@@ -113,7 +113,7 @@ export class HeroViewComp extends CCComp {
private initUINodes() {
this.top_node = this.node.getChildByName("top");
this.topOpacity = this.top_node.getComponent(UIOpacity) || this.top_node.addComponent(UIOpacity);
this.top_node.setPosition(0, 90+this.model.lv*10, 0);
this.top_node.setPosition(0, 80, 0);
this.topBasePos = this.top_node.position.clone();
const hpNode = this.top_node.getChildByName("hp");
if(this.model.fac==FacSet.HERO){
@@ -209,7 +209,7 @@ export class HeroViewComp extends CCComp {
this.top_node.active = true;
return;
}
this.top_node.active = !this.isFullHpAndNoShield();
this.top_node.active = true;
}
private activateTopBar() {