强化单局 弱化成长
This commit is contained in:
@@ -28,13 +28,10 @@ export class CardControllerComp extends CCComp {
|
||||
bbg_y:number=40
|
||||
bbg_x:any=[-300,-150,0,150,300]
|
||||
protected onLoad(): void {
|
||||
this.bbg=this.node.getChildByName("bar").getChildByName("bbg")
|
||||
oops.message.on(GameEvent.MissionStart,this.mission_home_to_mission,this)
|
||||
// oops.message.on(GameEvent.MissionEnd,this.mission_home_to_mission,this)
|
||||
}
|
||||
start() {
|
||||
this.bbg=this.node.getChildByName("bar").getChildByName("bbg")
|
||||
this.bbg.setPosition(v3(this.bbg_x[2],this.bbg_y))
|
||||
this.page_init()
|
||||
}
|
||||
|
||||
@@ -50,15 +47,9 @@ export class CardControllerComp extends CCComp {
|
||||
}
|
||||
page_init(){
|
||||
this.node.getChildByName("mission_home").active=true;
|
||||
this.node.getChildByName("hero_home").active = false;
|
||||
this.node.getChildByName("shop_home").active = false;
|
||||
this.node.getChildByName("battle_home").active = false;
|
||||
this.node.getChildByName("luck_home").active = false;
|
||||
this.node.getChildByName("mission").active = false;
|
||||
|
||||
|
||||
}
|
||||
mission_home_to_mission(){
|
||||
this.node.getChildByName("bar").active=false;
|
||||
let mission=this.node.getChildByName("mission").getComponent(MissionComp)
|
||||
mission.node.active = true;
|
||||
mission.mission_start()
|
||||
@@ -66,43 +57,10 @@ export class CardControllerComp extends CCComp {
|
||||
}
|
||||
mission_to_mission_home(){
|
||||
let mission_home=this.node.getChildByName("mission_home").getComponent(MissionHomeComp)
|
||||
this.bar_change(null,"home")
|
||||
this.node.getChildByName("bar").active=true;
|
||||
this.node.getChildByName("mission_home").active = true
|
||||
mission_home.load_ui_heros()
|
||||
}
|
||||
bar_change(e:any,args:any){
|
||||
console.log("bar_change",args)
|
||||
this.node.getChildByName("bar").active=true;
|
||||
this.node.getChildByName("mission").active = false;
|
||||
this.node.getChildByName("hero_home").active = false
|
||||
this.node.getChildByName("mission_home").active = false
|
||||
this.node.getChildByName("shop_home").active = false
|
||||
this.node.getChildByName("battle_home").active = false
|
||||
this.node.getChildByName("luck_home").active = false
|
||||
switch(args){
|
||||
case "hero":
|
||||
this.node.getChildByName("hero_home").active = true
|
||||
this.bbg.setPosition(v3(this.bbg_x[1],this.bbg_y))
|
||||
break;
|
||||
case "shop":
|
||||
this.node.getChildByName("shop_home").active = true
|
||||
this.bbg.setPosition(v3(this.bbg_x[0],this.bbg_y))
|
||||
break;
|
||||
// case "battle":
|
||||
// this.node.getChildByName("battle_home").active = true
|
||||
// this.bbg.setPosition(v3(this.bbg_x[4],this.bbg_y))
|
||||
break;
|
||||
case "luck":
|
||||
this.node.getChildByName("luck_home").active = true
|
||||
this.bbg.setPosition(v3(this.bbg_x[3],this.bbg_y))
|
||||
break;
|
||||
case "home":
|
||||
this.node.getChildByName("mission_home").active = true
|
||||
this.bbg.setPosition(v3(this.bbg_x[2],this.bbg_y))
|
||||
this.node.getChildByName("mission_home").getComponent(MissionHomeComp).update_hero_cards()
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** 视图对象通过 ecs.Entity.remove(ControllerComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
reset() {
|
||||
|
||||
Reference in New Issue
Block a user