启示位置变化
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -39,7 +39,7 @@ export class Hero extends ecs.Entity {
|
|||||||
var scene = smc.map.MapView.scene;
|
var scene = smc.map.MapView.scene;
|
||||||
node.parent = scene.entityLayer!.node!
|
node.parent = scene.entityLayer!.node!
|
||||||
node.setPosition(pos)
|
node.setPosition(pos)
|
||||||
|
console.log("hero load",pos)
|
||||||
var hv = node.getComponent(HeroViewComp)!;
|
var hv = node.getComponent(HeroViewComp)!;
|
||||||
let hero= HeroInfo[uuid] // 共用英雄数据
|
let hero= HeroInfo[uuid] // 共用英雄数据
|
||||||
hv.scale = scale;
|
hv.scale = scale;
|
||||||
|
|||||||
@@ -48,9 +48,9 @@ export class MissionComp extends CCComp {
|
|||||||
}
|
}
|
||||||
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)
|
||||||
}
|
}
|
||||||
@@ -65,7 +65,7 @@ export class MissionComp extends CCComp {
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
show_herosc(event: string, args: any){
|
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 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的位置信息坐标缓动的目标
|
||||||
@@ -81,11 +81,11 @@ export class MissionComp extends CCComp {
|
|||||||
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
|
||||||
}
|
}
|
||||||
mission_start(){
|
mission_start(){
|
||||||
/* todo 关卡设定完善*/
|
/* todo 关卡设定完善*/
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ const { ccclass, property } = _decorator;
|
|||||||
export class MissionHeroCompComp extends CCComp {
|
export class MissionHeroCompComp extends CCComp {
|
||||||
timer:Timer=new Timer(2)
|
timer:Timer=new Timer(2)
|
||||||
start_pos:any={
|
start_pos:any={
|
||||||
0:{pos:v3(-140,130,0),has:false},
|
0:{pos:v3(-140,135,0),has:false},
|
||||||
1:{pos:v3(-220,130,0),has:false},
|
1:{pos:v3(-270,205,0),has:false},
|
||||||
2:{pos:v3(-300,130,0),has:false},
|
2:{pos:v3(-270,65,0),has:false},
|
||||||
}
|
}
|
||||||
onLoad(){
|
onLoad(){
|
||||||
this.on(GameEvent.UserHeroCard,this.call_hero,this)
|
this.on(GameEvent.UserHeroCard,this.call_hero,this)
|
||||||
@@ -58,7 +58,8 @@ export class MissionHeroCompComp extends CCComp {
|
|||||||
}
|
}
|
||||||
let hero = ecs.getEntity<Hero>(Hero);
|
let hero = ecs.getEntity<Hero>(Hero);
|
||||||
let scale = 1
|
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);
|
hero.load(pos,scale,uuid,info);
|
||||||
this.start_pos[HeroInfo[uuid].type].has=true
|
this.start_pos[HeroInfo[uuid].type].has=true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user