This commit is contained in:
2024-12-11 16:55:06 +08:00
parent eab71044d0
commit de39c74d4a
17 changed files with 3434 additions and 4543 deletions

View File

@@ -21,24 +21,24 @@ export class HeroSelectComp extends CCComp {
start() {
this.mhc_home=this.node.parent.parent.parent.parent.getComponent(MissionHomeComp);
if(smc.vmdata.fight_heros.indexOf(this.h_uuid)>=0){
if(smc.fight_heros.indexOf(this.h_uuid)>=0){
this.show_bg(true)
}else{
this.show_bg(false)
}
}
select(){
if(smc.vmdata.fight_heros.indexOf(this.h_uuid)>=0){
smc.vmdata.fight_heros.splice(smc.vmdata.fight_heros.indexOf(this.h_uuid),1)
if(smc.fight_heros.indexOf(this.h_uuid)>=0){
smc.fight_heros.splice(smc.fight_heros.indexOf(this.h_uuid),1)
this.show_bg(false)
this.mhc_home.cancel_hero(this.h_uuid)
return
}
if(smc.vmdata.fight_heros.length>= 5){
if(smc.fight_heros.length>= 5){
oops.gui.toast("英雄数量不能超过5个")
return
}
smc.vmdata.fight_heros.push(this.h_uuid)
smc.fight_heros.push(this.h_uuid)
this.mhc_home.select_hero(this.h_uuid)
this.show_bg(true)
}