启示位置变化

This commit is contained in:
2025-04-22 16:19:43 +08:00
parent b75ee1da2d
commit d3cdbff3d9
4 changed files with 489 additions and 977 deletions

View File

@@ -39,7 +39,7 @@ export class Hero extends ecs.Entity {
var scene = smc.map.MapView.scene;
node.parent = scene.entityLayer!.node!
node.setPosition(pos)
console.log("hero load",pos)
var hv = node.getComponent(HeroViewComp)!;
let hero= HeroInfo[uuid] // 共用英雄数据
hv.scale = scale;

View File

@@ -48,9 +48,9 @@ export class MissionComp extends CCComp {
}
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.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)
}
@@ -65,7 +65,7 @@ export class MissionComp extends CCComp {
// }
}
show_herosc(event: string, args: any){
this.node.getChildByName('hbg').active=true
// 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的位置信息坐标缓动的目标
@@ -81,11 +81,11 @@ export class MissionComp extends CCComp {
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.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
// this.node.getChildByName('hbg').active=false
}
mission_start(){
/* todo 关卡设定完善*/

View File

@@ -19,9 +19,9 @@ const { ccclass, property } = _decorator;
export class MissionHeroCompComp extends CCComp {
timer:Timer=new Timer(2)
start_pos:any={
0:{pos:v3(-140,130,0),has:false},
1:{pos:v3(-220,130,0),has:false},
2:{pos:v3(-300,130,0),has:false},
0:{pos:v3(-140,135,0),has:false},
1:{pos:v3(-270,205,0),has:false},
2:{pos:v3(-270,65,0),has:false},
}
onLoad(){
this.on(GameEvent.UserHeroCard,this.call_hero,this)
@@ -58,7 +58,8 @@ export class MissionHeroCompComp extends CCComp {
}
let hero = ecs.getEntity<Hero>(Hero);
let scale = 1
let pos:Vec3 = v3(HeroPos[HeroInfo[uuid].type].pos);
let pos:Vec3 = this.start_pos[HeroInfo[uuid].type].pos;
console.log("hero load0",pos,this.start_pos)
hero.load(pos,scale,uuid,info);
this.start_pos[HeroInfo[uuid].type].has=true
}