继续
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user