feat(map): 新增英雄图鉴相关组件与配置

1.  新增CardLiteComp卡牌组件、HerosListComp英雄列表组件
2.  新增cardlite预制体及其元配置
3.  重构HlistComp移除旧的英雄图标节点与切换按钮逻辑
This commit is contained in:
panw
2026-05-27 10:08:16 +08:00
parent 51813826ad
commit ff2785680d
8 changed files with 8176 additions and 11228 deletions

View File

@@ -44,18 +44,7 @@ export class HListComp extends CCComp {
/** 中间位英雄 idle 图标节点 */
@property(Node)
hero_icon=null!
/** 左侧第 1 位英雄图标 */
@property(Node)
phero_icon=null!
/** 右侧第 1 位英雄图标 */
@property(Node)
nhero_icon=null!
/** 左侧第 2 位英雄图标(最远) */
@property(Node)
phero1_icon=null!
/** 右侧第 2 位英雄图标(最远) */
@property(Node)
nhero1_icon=null!
/** 攻击力标签节点 */
@property(Node)
ap_node=null!
@@ -69,11 +58,7 @@ export class HListComp extends CCComp {
@property(Node)
name_node=null!
/** 向左切换按钮 */
@property(Node)
pre_btn=null!
/** 向右切换按钮 */
@property(Node)
next_btn=null!
@property(Node)
lv_node=null!
@@ -95,9 +80,7 @@ export class HListComp extends CCComp {
debugMode: boolean = false;
onLoad() {
// 绑定左右切换按钮事件
this.pre_btn?.on(NodeEventType.TOUCH_END, this.onPreClick, this);
this.next_btn?.on(NodeEventType.TOUCH_END, this.onNextClick, this);
}
/** 预留:弹窗打开时接收参数 */
onAdded(args: any) {
@@ -108,11 +91,7 @@ export class HListComp extends CCComp {
oops.gui.remove(UIID.Heros)
}
start() {
// 初始化轮播节点数组和固定位置
if (this.phero1_icon && this.phero_icon && this.hero_icon && this.nhero_icon && this.nhero1_icon) {
this.carouselNodes = [this.phero1_icon, this.phero_icon, this.hero_icon, this.nhero_icon, this.nhero1_icon];
this.fixedPositions = this.carouselNodes.map(n => n.position.clone());
}
// 设置初始选中并加载所有位置的英雄动画
if (HeroList && HeroList.length > 0) {