This commit is contained in:
2024-09-02 09:03:43 +08:00
parent 9028b86d4e
commit f367d1817a
27 changed files with 3953 additions and 3233 deletions

View File

@@ -23,6 +23,7 @@ export class HeroCardViewComp extends CCComp {
pos_y:number = 0;
card_type:number = 1;
card_level:number = 1;
alive:boolean = false;
protected onLoad(): void {
this.node.on(NodeEventType.TOUCH_START, this.onTouchMove, this);
@@ -73,18 +74,26 @@ export class HeroCardViewComp extends CCComp {
}
do_active(){
// console.log(this.node.getChildByName("active"),this.node.getChildByName("use"), this.node.getChildByName("bag"))
let active = this.node.getChildByName("active")
// let active = this.node.getChildByName("active")
// let use = this.node.getChildByName("use")
// let bag = this.node.getChildByName("bag")
active.active = !active.active
// active.active = !active.active
// use.active = !use.active
// bag.active = !bag.active
this.alive=!this.alive
if(this.alive){
this.node.setScale(1.5,1.5,1)
}else{
this.node.setScale(1,1,0)
}
}
no_active(){
let active = this.node.getChildByName("active")
// let use = this.node.getChildByName("use")
// let bag = this.node.getChildByName("bag")
active.active = false
this.node.setScale(1,1)
// use.active = false
// bag.active = false
}
@@ -122,12 +131,12 @@ export class HeroCardViewComp extends CCComp {
}
}
do_use_card(){
switch (this.card_type) { // 添加括号并修正语法
switch (this.card_type) {
case 1:
oops.message.dispatchEvent("do_add_hero", { uuid: this.card_uid }); // 添加分号
oops.message.dispatchEvent("do_add_hero", { uuid: this.card_uid });
break;
case 2:
oops.message.dispatchEvent("do_use_skill", { uuid: this.card_uid }); // 添加分号
oops.message.dispatchEvent("do_use_skill", { uuid: this.card_uid });
// console.log("do_use_skill",this.card_uid)
break;
default: