This commit is contained in:
panw
2025-04-24 10:44:21 +08:00
parent d3cdbff3d9
commit ff01b741fc
3 changed files with 2004 additions and 3067 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -47,11 +47,11 @@ export class MissionComp extends CCComp {
// this.MMSComp.s_uuid=smc.mission.mmskill // this.MMSComp.s_uuid=smc.mission.mmskill
} }
start() { start() {
this.heros_node=this.node.getChildByName("heros") // this.heros_node=this.node.getChildByName("heros")
// this.herosc_node=this.node.getChildByName("herosc") // this.herosc_node=this.node.getChildByName("herosc")
// this.herosc_node.active=false // this.herosc_node.active=false
// this.node.getChildByName('hbg').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.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) // this.VictoryComp=this.node.getChildByName("victory").getComponent(VictoryComp)
} }
@@ -68,22 +68,22 @@ export class MissionComp extends CCComp {
// this.node.getChildByName('hbg').active=true // this.node.getChildByName('hbg').active=true
const screenSize = this.node.getComponent(UITransform).contentSize; const screenSize = this.node.getComponent(UITransform).contentSize;
const centerY = screenSize.height / 2; const centerY = screenSize.height / 2;
tween(this.heros_node).to(0.1,{position:v3(this.heros_node.position.x,centerY,0)}, // 这里以node的位置信息坐标缓动的目标 // tween(this.heros_node).to(0.1,{position:v3(this.heros_node.position.x,centerY,0)}, // 这里以node的位置信息坐标缓动的目标
{ // ITweenOption 的接口实现: // { // ITweenOption 的接口实现:
onComplete:()=>{ // onComplete:()=>{
this.herosc_node.active=true // this.herosc_node.active=true
this.heros_node.active=false // this.heros_node.active=false
this.hero_args=args // this.hero_args=args
} // }
}).start() // }).start()
} }
call_hero(event: string, args: any){ call_hero(event: string, args: any){
console.log("call_hero",args) console.log("call_hero",args)
oops.message.dispatchEvent(GameEvent.CallHero,{uuid:this.hero_args.uuid,pos:args}) oops.message.dispatchEvent(GameEvent.CallHero,{uuid:this.hero_args.uuid,pos:args})
// this.herosc_node.active=false // this.herosc_node.active=false
this.heros_node.active=true // this.heros_node.active=true
this.heros_node.position=this.heros_node_pos // this.heros_node.position=this.heros_node_pos
this.hero_args=null this.hero_args=null
// this.node.getChildByName('hbg').active=false // this.node.getChildByName('hbg').active=false
} }

View File

@@ -49,8 +49,10 @@ export class MissionHeroCompComp extends CCComp {
console.log("call_hero",uuid) console.log("call_hero",uuid)
this.addHero(uuid) this.addHero(uuid)
} }
/** 添加玩家 */ /** 添加玩家 */
private addHero(uuid:number=1001) { private addHero(uuid:number=1001) {
let heros=ecs.query(ecs.allOf(HeroModelComp))
console.log("call_hero addHero",uuid) console.log("call_hero addHero",uuid)
let info:any={ap:0,hp:0} let info:any={ap:0,hp:0}
if(this.start_pos[HeroInfo[uuid].type].has){ if(this.start_pos[HeroInfo[uuid].type].has){