This commit is contained in:
panw
2025-04-27 16:08:39 +08:00
parent d75cce01d7
commit ff172c7f72
4 changed files with 29 additions and 87 deletions

View File

@@ -38,54 +38,26 @@ export class MissionComp extends CCComp {
herosc_node:any=null
hero_args:any=null
onLoad(){
// this.on(GameEvent.UserHeroCard,this.show_herosc,this)
// this.MSComp=this.node.getChildByName("msk").getComponent(MSkillComp)
// this.MMSComp=this.node.getChildByName("mmsk").getComponent(MSkillComp)
// this.MSComp.group=BoxSet.HERO
// this.MSComp.s_uuid=smc.mission.mskill
// this.MMSComp.group=BoxSet.MONSTER
// this.MMSComp.s_uuid=smc.mission.mmskill
}
start() {
// this.heros_node=this.node.getChildByName("heros")
// this.herosc_node=this.node.getChildByName("herosc")
// this.herosc_node.active=false
// this.node.getChildByName('hbg').active=false
// this.heros_node_pos=v3(this.heros_node.position.x,this.heros_node.position.y,this.heros_node.position.z)
// this.VictoryComp=this.node.getChildByName("victory").getComponent(VictoryComp)
}
start() {
}
protected update(dt: number): void {
if(!smc.mission.play||smc.mission.pause){
return
}
// if (this.game_timer.update(dt)) {
// smc.vmdata.game.g_time += 1;
// }
}
show_herosc(event: string, args: any){
// this.node.getChildByName('hbg').active=true
const screenSize = this.node.getComponent(UITransform).contentSize;
const centerY = screenSize.height / 2;
// tween(this.heros_node).to(0.1,{position:v3(this.heros_node.position.x,centerY,0)}, // 这里以node的位置信息坐标缓动的目标
// { // ITweenOption 的接口实现:
// onComplete:()=>{
// this.herosc_node.active=true
// this.heros_node.active=false
// this.hero_args=args
// }
// }).start()
}
call_hero(event: string, args: any){
console.log("call_hero",args)
oops.message.dispatchEvent(GameEvent.CallHero,{uuid:this.hero_args.uuid,pos:args})
// this.herosc_node.active=false
// this.heros_node.active=true
// this.heros_node.position=this.heros_node_pos
this.hero_args=null
// this.node.getChildByName('hbg').active=false
}
mission_start(){
/* todo 关卡设定完善*/
@@ -93,7 +65,6 @@ export class MissionComp extends CCComp {
smc.mission.status=1
this.colose_victory()
this.mission_init()
// this.mskill_init()
}
mission_end(){
@@ -121,6 +92,7 @@ export class MissionComp extends CCComp {
let home =this.node.parent.getComponent(CardControllerComp);
home.mission_to_mission_home()
}
mission_init(){
//局内数据初始化
this.fight_start=false
@@ -129,20 +101,7 @@ export class MissionComp extends CCComp {
}
mskill_init(){
this.MSComp.group=BoxSet.HERO
this.MMSComp.group=BoxSet.MONSTER
this.MSComp.init()
this.MMSComp.init()
}
get_mons(){
return ecs.query(ecs.allOf(MonModelComp));
}
get_heros(){
return ecs.query(ecs.allOf(HeroModelComp))
}
card_refresh(){
oops.message.dispatchEvent(GameEvent.CardRefresh)
}