feat: 新增刷新石机制并优化抽卡消耗逻辑
1. 新增refresh_stone玩家数据字段与对应变更事件 2. 实现刷新石的获取、消耗和刷新可用性校验逻辑 3. 抽卡优先消耗刷新石,不足时再扣除金币 4. 为购买按钮添加可配置的消耗标签,优化UI查找逻辑 5. 更新对应预制件绑定新的消耗标签组件
This commit is contained in:
@@ -69,6 +69,10 @@ export class SCardComp extends CCComp {
|
||||
@property({ type: Node })
|
||||
private buy_node: Node = null;
|
||||
|
||||
/** 消费金币标签(未绑定时回退查找 buy_node 下的 num/Label 子节点) */
|
||||
@property(Label)
|
||||
private cost_label: Label = null;
|
||||
|
||||
// ======================== 运行时状态 ========================
|
||||
|
||||
/** 当前技能的卡牌配置 */
|
||||
@@ -232,7 +236,8 @@ export class SCardComp extends CCComp {
|
||||
// 购买按钮费用显示
|
||||
if (this.buy_node) {
|
||||
this.buy_node.active = true;
|
||||
const costLabel = this.buy_node.getChildByName("num")?.getComponent(Label)
|
||||
const costLabel = this.cost_label
|
||||
|| this.buy_node.getChildByName("num")?.getComponent(Label)
|
||||
|| this.buy_node.getComponentInChildren(Label);
|
||||
if (costLabel) {
|
||||
costLabel.string = `${this.cardData.cost ?? 0}`;
|
||||
|
||||
Reference in New Issue
Block a user