refactor(HInfoComp): 简化卡牌等级显示逻辑

1. 将lv_node从Node改为Label类型,直接通过string属性更新等级文本
2. 移除原有的子节点遍历匹配逻辑,替换为更简洁的文本赋值方式
3. 新增pool_lv_node节点属性用于后续池等级相关逻辑
4. 同步更新了ha2.prefab的预制体结构与meta配置文件
This commit is contained in:
panw
2026-05-25 09:03:34 +08:00
parent 518a9a1ce9
commit 350b107d2a
6 changed files with 4655 additions and 8013 deletions

View File

@@ -47,13 +47,10 @@
},
{
"__id__": 53
},
{
"__id__": 55
}
],
"_prefab": {
"__id__": 57
"__id__": 55
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -898,32 +895,6 @@
"__type__": "cc.CompPrefabInfo",
"fileId": "23j+p5lLdC+r4iKSVeLNM4"
},
{
"__type__": "cc.Animation",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 56
},
"playOnLoad": false,
"_clips": [
{
"__uuid__": "cd3e0604-8840-4794-8755-f2ed86dbe264",
"__expectedType__": "cc.AnimationClip"
}
],
"_defaultClip": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "49+IQe4gZPPYzJ/FgxeX/O"
},
{
"__type__": "cc.PrefabInfo",
"root": {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "bf40528a-fcf8-44da-af2e-d6b113904f35",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "pool_lv"
}
}

View File

@@ -66,9 +66,11 @@ export class HInfoComp extends CCComp {
@property(Node)
info_node=null!
@property(Node)
lv_node=null!
@property(Label)
lv_node: Label = null!
@property(Node)
pool_lv_node: Node = null!
@property(Node)
ap_node=null!
@@ -162,12 +164,7 @@ export class HInfoComp extends CCComp {
// ---- 卡牌等级显示 ----
if (this.lv_node) {
const currentLv = this.model.lv ?? 1;
this.lv_node.children.forEach(child => {
if (child.name.startsWith('lv')) {
const nodeLv = parseInt(child.name.substring(2));
child.active = !isNaN(nodeLv) && nodeLv <= currentLv;
}
});
this.lv_node.string = `Lv.${currentLv}`;
}
// ---- 图标动画(仅在 UUID 变化时重新加载) ----