refactor(hero): 移除英雄等级显示相关逻辑

1. 从HeroTopBarComp中移除等级Label组件、lvShow方法以及等级显示调用
2. 从HeroViewComp的update逻辑中移除等级脏数据监听
3. 调整英雄顶栏预制体的布局参数并隐藏等级节点
This commit is contained in:
panFD
2026-08-13 23:16:44 +08:00
parent 15d14f7d59
commit 4fee02d82e
3 changed files with 18 additions and 35 deletions

View File

@@ -98,7 +98,7 @@
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 9.114,
"x": 0,
"y": 10,
"z": 0
},
@@ -220,7 +220,7 @@
"__id__": 17
}
],
"_active": false,
"_active": true,
"_components": [
{
"__id__": 25
@@ -238,7 +238,7 @@
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": -9.738,
"y": -7.84,
"z": 0
},
"_lrot": {
@@ -290,7 +290,7 @@
},
"_lpos": {
"__type__": "cc.Vec3",
"x": -35,
"x": -20,
"y": 0,
"z": 0
},
@@ -331,8 +331,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 70,
"height": 10
"width": 40,
"height": 5
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -509,8 +509,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 240,
"height": 40
"width": 140,
"height": 23.333333333333336
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -634,8 +634,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 70,
"height": 10
"width": 40,
"height": 5
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -862,7 +862,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 40,
"height": 11
"height": 9
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -1040,7 +1040,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 140,
"height": 43.333333333333336
"height": 36.66666666666667
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -1165,7 +1165,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 40,
"height": 11
"height": 9
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -1392,7 +1392,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 40,
"height": 11
"height": 9
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -1695,7 +1695,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 40,
"height": 11
"height": 9
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -2541,7 +2541,6 @@
"__type__": "c4181/FEWhKbY0D0PLdCyKi",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
@@ -2559,7 +2558,7 @@
"hpBarSprite": {
"__id__": 36
},
"_id": ""
"_id": "a77QVRkP5NX4b+LyqmW1KJ"
},
{
"__type__": "cc.CompPrefabInfo",

View File

@@ -1,4 +1,4 @@
import { _decorator, Label, ProgressBar, Sprite, UIOpacity, Vec3, v3, tween, Tween, Color, clamp } from "cc";
import { _decorator, ProgressBar, Sprite, UIOpacity, Vec3, v3, tween, Tween, Color, clamp } from "cc";
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
import { HeroAttrsComp } from "./HeroAttrsComp";
@@ -12,7 +12,6 @@ const { ccclass, property } = _decorator;
* 挂载在英雄节点下的 "top" 子节点上,独立管理:
* - 血条进度ProgressBar
* - 护盾数值条ProgressBartop/shield 节点,显示 shield / SHIELD_MAX
* - 等级数字Label
* - 透明度激活 / 闲置
* - 受击抖动动画
*
@@ -27,9 +26,6 @@ export class HeroTopBarComp extends CCComp {
@property({ type: ProgressBar, tooltip: "血条进度条" })
private hpProgressBar: ProgressBar = null!;
@property({ type: Label, tooltip: "等级数字" })
private lvLabel: Label = null!;
@property({ type: ProgressBar, tooltip: "护盾数值条top 下的 shield 节点)" })
private shieldProgressBar: ProgressBar = null!;
@@ -88,12 +84,11 @@ export class HeroTopBarComp extends CCComp {
// 重置显示状态
this.node.getChildByName("hp")!.active = true;
this.node.getChildByName("cd")!.active = false;
this.node.getChildByName("lv")!.active = true;
this.node.getChildByName("lv")!.active = false;
this.node.active = true;
this.setTopBarOpacity(false);
this.hpShow();
this.lvShow();
this.shieldShow(model.shield);
}
@@ -125,12 +120,6 @@ export class HeroTopBarComp extends CCComp {
this.shieldProgressBar.node.active = shield > 0;
}
/** 更新等级数字 */
public lvShow(): void {
if (!this.lvLabel || !this._model) return;
this.lvLabel.string = String(this._model.lv);
}
/** 激活顶栏(高亮 + 延迟恢复闲置透明度) */
public activateTopBar(): void {
this.setTopBarOpacity(true);

View File

@@ -139,11 +139,6 @@ export class HeroViewComp extends CCComp {
this.topBar.shieldShow(this.model.shield);
this.model.dirty_shield = false;
}
if (this.model.dirty_lv) {
this.topBar.lvShow();
this.model.dirty_lv = false;
}
}
public cd_show() {