2 Commits

Author SHA1 Message Date
walkpan
aab38e3233 feat(英雄列表): 调整英雄卡牌UI并支持等级显示
- 调整英雄卡牌预制体的尺寸、缩放和位置
- 在英雄信息面板中添加等级节点显示
- 修改英雄属性显示逻辑,根据英雄等级计算属性值
- 移除冗余的技能信息更新代码,简化逻辑结构
2026-04-24 22:13:54 +08:00
walkpan
1289b668b7 feat(gui): 更新胜利界面UI布局和英雄列表组件
- 调整胜利界面多个元素的位置、尺寸和激活状态,优化视觉布局
- 修改英雄列表组件,移除攻击力和生命值标签前缀,添加等级节点属性
- 更新角色控制器预制件的序列化字段
2026-04-24 20:44:14 +08:00
7 changed files with 9681 additions and 5383 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1056,7 +1056,7 @@
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 120,
"y": 106.286,
"z": 0
},
"_lrot": {
@@ -1106,7 +1106,7 @@
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 156.635,
"y": -3.51,
"z": 0
},
"_lrot": {
@@ -1118,8 +1118,8 @@
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1.6,
"y": 1.6,
"x": 1.2,
"y": 1.2,
"z": 1
},
"_mobility": 0,
@@ -1242,7 +1242,7 @@
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 185.87,
"y": 25.725,
"z": 0
},
"_lrot": {
@@ -1254,8 +1254,8 @@
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1.5,
"y": 1.5,
"x": 1.2,
"y": 1.2,
"z": 1
},
"_mobility": 0,
@@ -1400,7 +1400,7 @@
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 142.14699999999993,
"y": 0.01300000000000523,
"z": 0
},
"_lrot": {
@@ -1686,7 +1686,7 @@
"__id__": 65
}
],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 71
@@ -2007,7 +2007,7 @@
"__id__": 79
}
],
"_active": false,
"_active": true,
"_components": [
{
"__id__": 85
@@ -2025,7 +2025,7 @@
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0.5,
"y": 0,
"z": 0
},
"_lrot": {
@@ -2204,8 +2204,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 164,
"height": 223
"width": 156,
"height": 210
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -2649,7 +2649,7 @@
"__id__": 107
}
],
"_active": false,
"_active": true,
"_components": [
{
"__id__": 113
@@ -2667,7 +2667,7 @@
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0.5,
"y": 0,
"z": 0
},
"_lrot": {
@@ -2846,8 +2846,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 164,
"height": 223
"width": 156,
"height": 210
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -3392,7 +3392,7 @@
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 43.57249999999999,
"y": 28.300999999999995,
"z": 0
},
"_lrot": {
@@ -3735,7 +3735,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 160,
"height": 122.85500000000002
"height": 122.85500000000003
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -3832,8 +3832,8 @@
"_target": null,
"_left": 5,
"_right": 5,
"_top": 10,
"_bottom": 97.14499999999998,
"_top": 25.27149999999999,
"_bottom": 81.87349999999998,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
@@ -3889,7 +3889,7 @@
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": -11.616,
"y": -75.11,
"z": 0
},
"_lrot": {
@@ -4052,7 +4052,7 @@
"__id__": 210
}
],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 218
@@ -4458,7 +4458,7 @@
"__id__": 169
},
"_children": [],
"_active": false,
"_active": true,
"_components": [
{
"__id__": 187
@@ -5497,7 +5497,7 @@
"__id__": 223
},
"_children": [],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 233
@@ -5675,7 +5675,7 @@
"__id__": 223
},
"_children": [],
"_active": false,
"_active": true,
"_components": [
{
"__id__": 241
@@ -6031,7 +6031,7 @@
"__id__": 223
},
"_children": [],
"_active": false,
"_active": true,
"_components": [
{
"__id__": 257
@@ -6661,7 +6661,7 @@
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": -73.012,
"y": -138.796,
"z": 0
},
"_lrot": {
@@ -6723,8 +6723,8 @@
},
"_lpos": {
"__type__": "cc.Vec3",
"x": -0.35999999999999943,
"y": 28.624,
"x": -90,
"y": 0,
"z": 0
},
"_lrot": {
@@ -6818,7 +6818,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 140,
"height": 30
"height": 40
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -6892,8 +6892,8 @@
"_target": null,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_top": -5,
"_bottom": -5,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
@@ -6948,7 +6948,7 @@
},
"_lpos": {
"__type__": "cc.Vec3",
"x": -47.088,
"x": -56.573,
"y": 0,
"z": 0
},
@@ -6989,8 +6989,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 24,
"height": 24
"width": 45,
"height": 45
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -7126,7 +7126,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 80,
"height": 35
"height": 80
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -7164,10 +7164,10 @@
"_string": "9999",
"_horizontalAlign": 0,
"_verticalAlign": 1,
"_actualFontSize": 25,
"_fontSize": 25,
"_actualFontSize": 35,
"_fontSize": 40,
"_fontFamily": "Arial",
"_lineHeight": 35,
"_lineHeight": 49.9,
"_overflow": 2,
"_enableWrapText": true,
"_font": null,
@@ -7305,9 +7305,9 @@
"__prefab": {
"__id__": 312
},
"_alignFlags": 12,
"_alignFlags": 10,
"_target": null,
"_left": -3.3600000000000048,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 28.624,
@@ -7378,8 +7378,8 @@
},
"_lpos": {
"__type__": "cc.Vec3",
"x": -0.35999999999999943,
"y": -0.20400000000000063,
"x": 90,
"y": 0,
"z": 0
},
"_lrot": {
@@ -7473,7 +7473,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 140,
"height": 30
"height": 40
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -7547,8 +7547,8 @@
"_target": null,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_top": -5,
"_bottom": -5,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
@@ -7603,7 +7603,7 @@
},
"_lpos": {
"__type__": "cc.Vec3",
"x": -47.088,
"x": -56.573,
"y": 0,
"z": 0
},
@@ -7644,8 +7644,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 24,
"height": 24
"width": 45,
"height": 45
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -7781,7 +7781,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 80,
"height": 35
"height": 80
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -7819,10 +7819,10 @@
"_string": "9999",
"_horizontalAlign": 0,
"_verticalAlign": 1,
"_actualFontSize": 25,
"_fontSize": 25,
"_actualFontSize": 35,
"_fontSize": 40,
"_fontFamily": "Arial",
"_lineHeight": 35,
"_lineHeight": 49.9,
"_overflow": 2,
"_enableWrapText": true,
"_font": null,
@@ -7960,7 +7960,7 @@
"__prefab": {
"__id__": 340
},
"_alignFlags": 12,
"_alignFlags": 34,
"_target": null,
"_left": -3.359999999999997,
"_right": 0,
@@ -8011,8 +8011,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 134,
"height": 30
"width": 320,
"height": 50
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -8037,12 +8037,12 @@
"__prefab": {
"__id__": 345
},
"_alignFlags": 44,
"_alignFlags": 20,
"_target": null,
"_left": 18,
"_right": 18,
"_left": 35,
"_right": 35,
"_top": 0,
"_bottom": 26.988000000000007,
"_bottom": -48.796,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
@@ -8101,16 +8101,16 @@
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 107.705,
"x": 65.883,
"y": 96.593,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
"z": -0.17364817766693033,
"w": 0.984807753012208
},
"_lscale": {
"__type__": "cc.Vec3",
@@ -8124,7 +8124,7 @@
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
"z": -20
},
"_id": ""
},
@@ -8151,8 +8151,8 @@
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 51.992,
"x": 1.032,
"y": 0,
"z": 0
},
"_lrot": {
@@ -8192,8 +8192,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 127.6,
"height": 58
"width": 60.1748046875,
"height": 56.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -8228,11 +8228,11 @@
"b": 0,
"a": 255
},
"_string": "全场最佳",
"_string": "MVP",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 30,
"_fontSize": 30,
"_actualFontSize": 25,
"_fontSize": 25,
"_fontFamily": "Arial",
"_lineHeight": 40,
"_overflow": 0,
@@ -8241,7 +8241,7 @@
"_isSystemFontUsed": true,
"_spacingX": 0,
"_isItalic": false,
"_isBold": true,
"_isBold": false,
"_isUnderline": false,
"_underlineHeight": 2,
"_cacheMode": 0,
@@ -8253,7 +8253,7 @@
"b": 0,
"a": 255
},
"_outlineWidth": 3.8,
"_outlineWidth": 3,
"_enableShadow": false,
"_shadowColor": {
"__type__": "cc.Color",
@@ -8301,8 +8301,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 59,
"height": 60
"width": 90,
"height": 90
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -8338,7 +8338,7 @@
"a": 255
},
"_spriteFrame": {
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@8e30d",
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@a1429",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
@@ -8353,7 +8353,10 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_atlas": {
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73",
"__expectedType__": "cc.SpriteAtlas"
},
"_id": ""
},
{
@@ -8417,7 +8420,7 @@
"_target": null,
"_left": 198.00000000000028,
"_right": 0,
"_top": -0.14699999999996294,
"_top": 141.987,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
@@ -8494,8 +8497,8 @@
"_target": null,
"_left": 30,
"_right": 30,
"_top": 40,
"_bottom": 280,
"_top": 53.713999999999956,
"_bottom": 266.286,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
@@ -8602,7 +8605,7 @@
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 61.18700000000001,
"y": 382.909,
"z": 0
},
"_lrot": {
@@ -11323,7 +11326,7 @@
"_left": 10,
"_right": 10,
"_top": 625.809,
"_bottom": 441.187,
"_bottom": 762.909,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
@@ -11475,7 +11478,7 @@
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": -122.439,
"y": -208.727,
"z": 0
},
"_lrot": {

View File

@@ -1155,6 +1155,8 @@
"__id__": 0
},
"fileId": "d21aIQMhZKX6FaZRdSnfCE",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
@@ -24310,7 +24312,7 @@
"__id__": 1143
}
],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 1181

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 KiB

After

Width:  |  Height:  |  Size: 270 KiB

View File

@@ -18,7 +18,7 @@
* - HeroInfo / HeroListheroSet—— 英雄静态配置与全量英雄 UUID 列表
* - SkillSet / ITypeSkillSet—— 技能配置与类型枚举
*/
import { _decorator, Animation, AnimationClip, Button, Event, Label, Node, NodeEventType, Sprite, resources, tween, Vec3 } from "cc";
import { _decorator, Animation, AnimationClip, Button, Event, Label, Node, NodeEventType, Sprite, resources, tween, Vec3, Widget } 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 { HeroInfo, HeroList } from "../common/config/heroSet";
@@ -74,6 +74,8 @@ export class HListComp extends CCComp {
/** 向右切换按钮 */
@property(Node)
next_btn=null!
@property(Node)
lv_node=null!
// ======================== 运行时状态 ========================
@@ -216,10 +218,37 @@ export class HListComp extends CCComp {
const hero = HeroInfo[this.huuid];
if (!hero) return;
this.setLabelText(this.name_node, hero.name);
this.setLabelText(this.ap_node, `攻击力: ${hero.ap}`);
this.setLabelText(this.hp_node, `生命值: ${hero.hp}`);
this.updateSkillInfo(hero);
const heroLv = Math.max(1, Math.floor(hero.lv ?? 1));
const suffix = heroLv >= 2 ? "★".repeat(heroLv - 1) : "";
this.setLabelText(this.name_node, `${suffix}${hero.name || ""}${suffix}`);
this.setLabelText(this.ap_node, `${(hero.ap ?? 0) * heroLv}`);
this.setLabelText(this.hp_node, `${(hero.hp ?? 0) * heroLv}`);
if (this.info_node) {
const infoLabel = this.info_node.getChildByName("info")?.getComponent(Label);
if (infoLabel) infoLabel.string = `${hero.info || ""}`;
}
const cardLvStr = `lv${hero.cards_lv ?? 1}`;
if (this.lv_node) {
this.lv_node.active = true;
this.lv_node.children.forEach(child => {
if (child.name === "light") {
child.active = false;
} else if (child.name === "bg") {
child.active = true;
} else {
child.active = (child.name === cardLvStr);
}
});
const widget = this.lv_node.getComponent(Widget);
if (widget) widget.updateAlignment();
this.lv_node.children.forEach(child => {
const childWidget = child.getComponent(Widget);
if (childWidget) childWidget.updateAlignment();
});
}
}
/** 初始化 5 个轮播位的英雄动画 */
@@ -313,64 +342,7 @@ export class HListComp extends CCComp {
return null;
}
// ======================== 技能信息 ========================
/**
* 更新技能信息面板:
* 遍历英雄的技能列表,为 Line1~Line5 节点填充技能名、等级、CD、描述。
* 同时根据技能类型(近战 / 远程 / 辅助)切换对应图标。
*
* @param hero 英雄配置数据(含 skills 字段)
*/
private updateSkillInfo(hero: any) {
if (!this.info_node) return;
const skills = Object.values(hero.skills || {});
for (let i = 1; i <= 5; i++) {
let line = this.findNodeByName(this.info_node, `Line${i}`) || this.findNodeByName(this.info_node, `line${i}`);
if (!line) continue;
const skill: any = skills[i - 1];
if (skill) {
line.active = true;
const skillId = skill.uuid;
const config = SkillSet[skillId];
// 拼接技能信息文本
const text = config ? `${config.name} Lv.${skill.lv} CD:${skill.cd}s ${config.info}` : `未知技能 CD:${skill.cd}s`;
const noteNode = this.findNodeByName(line, "note");
const label = noteNode?.getComponent(Label) || noteNode?.getComponentInChildren(Label) || line.getComponentInChildren(Label);
if (label) {
label.string = text;
}
// 切换技能类型图标
this.updateLineTypeIcon(line, config?.IType);
} else {
line.active = false;
}
}
}
/**
* 更新技能行的类型图标(互斥显示):
* - Melee → 近战图标
* - remote → 远程图标
* - support → 辅助图标
*
* @param line 技能行节点
* @param iType 技能类型枚举
*/
private updateLineTypeIcon(line: Node, iType?: IType) {
const meleeNode = this.findNodeByName(line, "Melee");
const remoteNode = this.findNodeByName(line, "remote");
const supportNode = this.findNodeByName(line, "support");
if (meleeNode) meleeNode.active = iType === IType.Melee;
if (remoteNode) remoteNode.active = iType === IType.remote;
if (supportNode) supportNode.active = iType === IType.support;
}
/** ECS 组件移除时销毁节点 */
reset() {