feat: 新增技能图标组件与UI优化
1. 新增SSkillBoxComp技能小图标组件,支持技能展示与状态控制 2. 优化CardLiteComp选中态动画,改为缩放高亮效果 3. 为英雄列表、任务主页添加顶部栏显示控制逻辑 4. 调整部分预制件布局与节点配置
This commit is contained in:
@@ -37,6 +37,9 @@ const { ccclass, property } = _decorator;
|
||||
export class CardLiteComp extends CCComp {
|
||||
private debugMode: boolean = false;
|
||||
|
||||
/** 选中态放大倍率 */
|
||||
private static readonly SELECT_SCALE: number = 1.08;
|
||||
|
||||
// ======================== 编辑器绑定节点 ========================
|
||||
|
||||
@property(Node)
|
||||
@@ -109,12 +112,15 @@ export class CardLiteComp extends CCComp {
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置选中态:切换根节点下 `active` 子节点的显隐(不再通过缩放表达选中)。
|
||||
* 设置选中态:选中卡微微放大,取消选中恢复原尺寸。
|
||||
* @param selected 是否选中
|
||||
*/
|
||||
setSelected(selected: boolean) {
|
||||
const mark = this.node.getChildByName("active");
|
||||
if (mark) mark.active = selected;
|
||||
Tween.stopAllByTarget(this.node);
|
||||
const target = selected ? CardLiteComp.SELECT_SCALE : 1;
|
||||
tween(this.node)
|
||||
.to(0.12, { scale: new Vec3(target, target, 1) }, { easing: 'quadOut' })
|
||||
.start();
|
||||
}
|
||||
|
||||
// ======================== 事件绑定 ========================
|
||||
|
||||
Reference in New Issue
Block a user