This commit is contained in:
2024-08-16 08:45:09 +08:00
parent c67a149620
commit dc12cea962
20 changed files with 1256 additions and 558 deletions

View File

@@ -39,6 +39,11 @@ export class CardControllerComp extends CCComp {
if (this.in_load) {
return
}
if (smc.vm_data.gold.min < smc.vm_data.gold.ref_cost) {
oops.gui.toast("金币不足")
return
}
smc.vm_data.gold.min -= smc.vm_data.gold.ref_cost;
this.load_cards()
}
@@ -47,7 +52,9 @@ export class CardControllerComp extends CCComp {
let old_cards = ecs.query(ecs.allOf(HeroCardViewComp))
if (old_cards.length > 0) {
old_cards.forEach(element => {
element.destroy();
if (!element.get(HeroCardViewComp).in_destroy) {
element.destroy();
}
});
}
// console.log(old_cards)