修复 同时刷新卡牌bug
This commit is contained in:
@@ -79,8 +79,8 @@ export class SingletonModuleComp extends ecs.Comp {
|
||||
max: 30
|
||||
},
|
||||
gold: {
|
||||
min: 0,
|
||||
max: 4,
|
||||
min: 200,
|
||||
max: 200,
|
||||
max_limit:10,
|
||||
time:0,
|
||||
cd:1,
|
||||
|
||||
@@ -54,12 +54,24 @@ export class CardControllerComp extends CCComp {
|
||||
if (this.in_load) {
|
||||
return
|
||||
}
|
||||
if((smc.vm_data.shuaxin.max-smc.vm_data.shuaxin.min) < 1 ){
|
||||
oops.gui.toast("马上就要刷新了")
|
||||
return
|
||||
}
|
||||
if(smc.vm_data.shuaxin.min < 0.5){
|
||||
oops.gui.toast("不要刷新太快哦")
|
||||
return
|
||||
}
|
||||
if (smc.vm_data.gold.min < smc.vm_data.cards.ref_cost) {
|
||||
oops.gui.toast("金币不足")
|
||||
return
|
||||
}
|
||||
smc.vm_data.gold.min -= smc.vm_data.cards.ref_cost;
|
||||
this.load_cards()
|
||||
smc.vm_data.shuaxin.min = -5
|
||||
if(smc.vm_data.shuaxin.min <=0 ){
|
||||
smc.vm_data.shuaxin.min = 0
|
||||
}
|
||||
|
||||
}
|
||||
load_cards() {
|
||||
|
||||
@@ -64,8 +64,8 @@ export class HeroCard extends ecs.Entity {
|
||||
// node.getChildByName("avatar").setScale(node.getChildByName("avatar").scale.x*scale, node.getChildByName("avatar").scale.y, node.getChildByName("avatar").scale.z);
|
||||
node.setPosition(pos)
|
||||
|
||||
|
||||
resources.load(url, SpriteAtlas, (err: any, atlas) => {
|
||||
console.log("hero_card load",node)
|
||||
const sprite = node.getChildByName("hero").getComponent(Sprite);
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(pathName);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user