fix: 修复卡片背景激活状态和池色显示逻辑
1. 默认禁用卡片背景节点初始激活状态 2. 根据卡牌池等级动态显示对应颜色的背景高亮 3. 非当前类型的卡片背景隐藏所有子颜色节点
This commit is contained in:
@@ -4352,7 +4352,7 @@
|
|||||||
"node": {
|
"node": {
|
||||||
"__id__": 1
|
"__id__": 1
|
||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": false,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 197
|
"__id__": 197
|
||||||
},
|
},
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -223,9 +223,22 @@ export class CardLiteComp extends CCComp {
|
|||||||
|
|
||||||
const kindName = CKind[this.cardData.kind];
|
const kindName = CKind[this.cardData.kind];
|
||||||
|
|
||||||
|
const poolColorNames = ["green", "blue", "purple", "yellow", "red"];
|
||||||
|
const poolColorIdx = Math.min(this.cardData.pool_lv, 5) - 1;
|
||||||
|
const activeColor = poolColorNames[poolColorIdx];
|
||||||
|
|
||||||
if (this.BG_node) {
|
if (this.BG_node) {
|
||||||
this.BG_node.children.forEach(child => {
|
this.BG_node.children.forEach(child => {
|
||||||
child.active = (child.name === kindName);
|
child.active = (child.name === kindName);
|
||||||
|
if (child.active) {
|
||||||
|
child.children.forEach(colorChild => {
|
||||||
|
colorChild.active = (colorChild.name === activeColor);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
child.children.forEach(colorChild => {
|
||||||
|
colorChild.active = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user