refactor: 将代码中的card_lv统一替换为rarity
本次提交完成了全项目范围内术语的统一替换,将原本指代卡牌品质/等级的card_lv字段全部重命名为rarity,对齐了设计文档中的命名规范,避免了术语混淆: 1. 更新了所有配置文件、组件类、数据结构中的字段定义 2. 同步修改了注释、文档说明中的相关表述 3. 修正了英雄、技能、装备卡牌的品质显示逻辑 4. 调整了背景颜色切换、属性计算等相关业务逻辑
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import { _decorator, Component } from "cc";
|
||||
import { CARD_LV_BG_COLORS } from "../common/config/GameSet";
|
||||
import { RARITY_BG_COLORS } from "../common/config/GameSet";
|
||||
|
||||
const { ccclass } = _decorator;
|
||||
|
||||
@ccclass('CardBgComp')
|
||||
export class CardBgComp extends Component {
|
||||
|
||||
apply(card_lv: number) {
|
||||
const color = CARD_LV_BG_COLORS[Math.min(card_lv, 5) - 1];
|
||||
apply(rarity: number) {
|
||||
const color = RARITY_BG_COLORS[Math.min(rarity, 5) - 1];
|
||||
this.node.children.forEach(c => c.active = c.name === color);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user