商品页初步完成

This commit is contained in:
2024-12-16 10:51:51 +08:00
parent 73ad199bfc
commit b9a188a7bb
12 changed files with 28937 additions and 14254 deletions

View File

@@ -47,59 +47,46 @@ export class CardControllerComp extends CCComp {
}
page_init(){
this.node.getChildByName("mission_home").active=true;
this.node.getChildByName("hero_home").setPosition(v3(1000,this.node.getChildByName("hero_home").position.y))
this.node.getChildByName("shop_home").setPosition(v3(1000,this.node.getChildByName("shop_home").position.y))
this.node.getChildByName("battle_home").setPosition(v3(1000,this.node.getChildByName("battle_home").position.y))
this.node.getChildByName("skill_home").setPosition(v3(1000,this.node.getChildByName("skill_home").position.y))
this.node.getChildByName("hero_home").active = false;
this.node.getChildByName("shop_home").active = false;
this.node.getChildByName("battle_home").active = false;
this.node.getChildByName("skill_home").active = false;
this.node.getChildByName("mission").active = false;
}
bar_change(e:any,args:any){
console.log("bar_change",args)
this.node.getChildByName("mission_home").active=true;
this.node.getChildByName("bar").active=true;
this.bbg.setPosition(v3(this.bbg_x[2],this.bbg_y))
this.node.getChildByName("mission").active = false;
this.node.getChildByName("hero_home").setPosition(v3(2000,this.node.getChildByName("hero_home").position.y))
this.node.getChildByName("shop_home").setPosition(v3(2000,this.node.getChildByName("shop_home").position.y))
this.node.getChildByName("battle_home").setPosition(v3(2000,this.node.getChildByName("battle_home").position.y))
this.node.getChildByName("skill_home").setPosition(v3(2000,this.node.getChildByName("skill_home").position.y))
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("skill_home").active = false
switch(args){
case "hero":
this.node.getChildByName("hero_home").setPosition(v3(0,this.node.getChildByName("hero_home").position.y))
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").setPosition(v3(0,this.node.getChildByName("shop_home").position.y))
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").setPosition(v3(0,this.node.getChildByName("battle_home").position.y))
// this.bbg.setPosition(v3(this.bbg_x[4],this.bbg_y))
oops.gui.toast("暂未开放")
// case "battle":
// this.node.getChildByName("battle_home").active = true
// this.bbg.setPosition(v3(this.bbg_x[4],this.bbg_y))
break;
case "skill":
this.node.getChildByName("skill_home").setPosition(v3(0,this.node.getChildByName("skill_home").position.y))
this.node.getChildByName("skill_home").active = true
this.bbg.setPosition(v3(this.bbg_x[3],this.bbg_y))
break;
break;
case "home":
this.node.getChildByName("mission_home").active = true
this.bbg.setPosition(v3(this.bbg_x[2],this.bbg_y))
break;
}
}
mission_start(){
this.node.getChildByName("bar").active=false;
this.node.getChildByName("mission_home").active=false;
this.node.getChildByName("mission").active = true;
smc.mission.play = true;
// oops.message.dispatchEvent("mission_start")
}
to_mission(){
this.bar_change(null,"home")
this.node.getChildByName("bar").active=true;
// tween(this.bbg).to(0.1,{Position:v3(this.bbg_x[2],this.bbg_y)}).start()
this.bbg.setPosition(this.bbg_x[2],this.bbg_y)
}
/** 视图对象通过 ecs.Entity.remove(ControllerComp) 删除组件是触发组件处理自定义释放逻辑 */
reset() {
this.node.destroy();