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
},