refactor(hero): 移除英雄等级显示相关逻辑
1. 从HeroTopBarComp中移除等级Label组件、lvShow方法以及等级显示调用 2. 从HeroViewComp的update逻辑中移除等级脏数据监听 3. 调整英雄顶栏预制体的布局参数并隐藏等级节点
This commit is contained in:
@@ -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)
|
||||
* - 护盾数值条(ProgressBar,top/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);
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user