feat: 添加等级颜色显示,优化卡池和英雄等级UI

1.  新增getLvColor工具函数,根据等级返回对应颜色
2.  为英雄信息面板和卡牌添加等级文本颜色设置
3.  重构卡池等级节点命名和显示逻辑,修复prefab布局
4.  新增英雄自身等级显示组件到卡牌预制件
This commit is contained in:
panw
2026-05-25 09:49:34 +08:00
parent 8d27a4bef3
commit 8026c2368e
5 changed files with 245 additions and 54 deletions

View File

@@ -68,19 +68,22 @@
},
{
"__id__": 529
},
{
"__id__": 557
}
],
"_active": true,
"_components": [
{
"__id__": 557
"__id__": 563
},
{
"__id__": 559
"__id__": 565
}
],
"_prefab": {
"__id__": 561
"__id__": 567
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -12587,6 +12590,165 @@
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "lvl",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 558
},
{
"__id__": 560
}
],
"_prefab": {
"__id__": 562
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": -43.506,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 557
},
"_enabled": true,
"__prefab": {
"__id__": 559
},
"_contentSize": {
"__type__": "cc.Size",
"width": 42.53515625,
"height": 54.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "4dqU3tFDtGbatoXWgLFpJA"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 557
},
"_enabled": true,
"__prefab": {
"__id__": 561
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_string": "Lv.1",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 20,
"_fontSize": 20,
"_fontFamily": "Arial",
"_lineHeight": 40,
"_overflow": 0,
"_enableWrapText": true,
"_font": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_isItalic": false,
"_isBold": true,
"_isUnderline": false,
"_underlineHeight": 2,
"_cacheMode": 0,
"_enableOutline": true,
"_outlineColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_outlineWidth": 2,
"_enableShadow": false,
"_shadowColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_shadowOffset": {
"__type__": "cc.Vec2",
"x": 2,
"y": 2
},
"_shadowBlur": 2,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "eccX4h4XFHYICC7LZQu1sK"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "b3jvDRk1NNjL5FE2pyUByW",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
@@ -12597,7 +12759,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 558
"__id__": 564
},
"_contentSize": {
"__type__": "cc.Size",
@@ -12625,7 +12787,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 560
"__id__": 566
},
"Lock": null,
"unLock": null,
@@ -12653,9 +12815,12 @@
"HF_node": {
"__id__": 290
},
"lv_node": {
"pool_lv_node": {
"__id__": 491
},
"lvl_node": {
"__id__": 560
},
"ap_node": {
"__id__": 529
},

View File

@@ -90,7 +90,7 @@
"__id__": 1
},
"_children": [],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 3
@@ -230,7 +230,7 @@
"__id__": 9
}
],
"_active": false,
"_active": true,
"_components": [
{
"__id__": 15
@@ -461,7 +461,7 @@
"__id__": 25
}
],
"_active": false,
"_active": true,
"_components": [
{
"__id__": 31
@@ -472,8 +472,8 @@
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 9.508,
"x": 12.84,
"y": 4.69,
"z": 0
},
"_lrot": {
@@ -831,7 +831,7 @@
"__id__": 47
}
],
"_active": false,
"_active": true,
"_components": [
{
"__id__": 53
@@ -842,8 +842,8 @@
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 9.508,
"x": 13.803,
"y": 4.931,
"z": 0
},
"_lrot": {
@@ -1340,7 +1340,7 @@
"__id__": 75
}
],
"_active": false,
"_active": true,
"_components": [
{
"__id__": 81
@@ -1351,8 +1351,8 @@
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 9.508,
"x": 14.526,
"y": 5.654,
"z": 0
},
"_lrot": {
@@ -1988,7 +1988,7 @@
"__id__": 109
}
],
"_active": false,
"_active": true,
"_components": [
{
"__id__": 115
@@ -1999,8 +1999,8 @@
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 9.508,
"x": 15.249,
"y": 6.376,
"z": 0
},
"_lrot": {
@@ -2775,7 +2775,7 @@
"__id__": 149
}
],
"_active": false,
"_active": true,
"_components": [
{
"__id__": 155
@@ -2786,8 +2786,8 @@
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 9.508,
"x": 14.285,
"y": 5.654,
"z": 0
},
"_lrot": {