逐步 去掉 主英雄设定
This commit is contained in:
@@ -46,34 +46,8 @@ export class MissionHeroCompComp extends CCComp {
|
||||
this.addHero(args.uuid,false,true)
|
||||
}
|
||||
|
||||
private call_friend(event: string, args: any,is_master:boolean=false){
|
||||
console.log("[MissionHeroComp]:call_hero addHero",args.uuid,is_master)
|
||||
let hero_pos=1
|
||||
if(is_master){
|
||||
hero_pos=0
|
||||
}
|
||||
let info:any={ap:0,hp:0,lv:0}
|
||||
let hero = ecs.getEntity<Hero>(Hero);
|
||||
let scale = 1
|
||||
let heros=ecs.query(ecs.allOf(HeroViewComp))
|
||||
for(let hero of heros){
|
||||
let hv = hero.get(HeroViewComp)
|
||||
if(hv.fight_pos==hero_pos){
|
||||
hero_pos=2
|
||||
break
|
||||
}
|
||||
}
|
||||
console.log("[MissionHeroComp]:call_friend",heros)
|
||||
let pos:Vec3 = HeroPos[hero_pos].pos;
|
||||
if(is_master){
|
||||
hero.hart_load(args.uuid)
|
||||
}else{
|
||||
hero.load(pos,scale,args.uuid,info,hero_pos);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
call_hero(event: string, args: any){
|
||||
// console.log("call_hero",args)
|
||||
@@ -83,7 +57,7 @@ export class MissionHeroCompComp extends CCComp {
|
||||
// let x=RandomManager.instance.getRandomInt(0,hero_list.length,1)
|
||||
// // let uuid=args.uuid
|
||||
// // console.log("call_hero",uuid)
|
||||
this.addHero(args.uuid,args.is_master)
|
||||
this.addHero(args.uuid,args.is_master,false)
|
||||
}
|
||||
|
||||
/** 添加英雄 */
|
||||
@@ -95,16 +69,11 @@ export class MissionHeroCompComp extends CCComp {
|
||||
if(is_zhaohuan){
|
||||
hero_pos=2
|
||||
}
|
||||
let info:any=this.get_info_and_remove(hero_pos,uuid)
|
||||
// let info:any={ap:0,hp:0,lv:0}
|
||||
|
||||
let hero = ecs.getEntity<Hero>(Hero);
|
||||
let scale = 1
|
||||
let pos:Vec3 = HeroPos[hero_pos].pos;
|
||||
if(is_master){
|
||||
hero.hart_load(uuid)
|
||||
}else{
|
||||
hero.load(pos,scale,uuid,info,hero_pos);
|
||||
}
|
||||
hero.load(pos,scale,uuid);
|
||||
}
|
||||
|
||||
get_info_and_remove(fight_pos:number,uuid:number){
|
||||
|
||||
Reference in New Issue
Block a user