This commit is contained in:
2024-08-12 09:38:47 +08:00
parent 21b559abcf
commit 9941b5149d
6 changed files with 57 additions and 59 deletions

View File

@@ -45,13 +45,11 @@ export class HeroCardViewComp extends CCComp {
let active = parent.getChildByName("active");
active.setPosition(this.node.position.x,this.node.position.y)
active.active = true;
console.log(parent);
// if(this.ent.eid == smc.vm_data.cards.eid){
// this.node.getChildByName("active").active = true;
// }else{
// this.node.getChildByName("active").active = false;
// }
console.log("onTouchMove");
let delta = event.getDelta();
this.node.setPosition(this.node.position.x+delta.x,this.node.position.y+delta.y);
}
@@ -68,7 +66,7 @@ export class HeroCardViewComp extends CCComp {
}
use_card(){
if(smc.vm_data.gold.min >= CardSet[this.card_uid].level){
oops.message.dispatchEvent("do_add_hero",this.ent)
oops.message.dispatchEvent("do_add_hero",{uuid:this.card_uid})
this.ent.destroy();
smc.vm_data.gold.min -= CardSet[this.card_uid].level;
}else{