diff --git a/assets/script/game/hero/Hero.ts b/assets/script/game/hero/Hero.ts index f4f64659..05083281 100644 --- a/assets/script/game/hero/Hero.ts +++ b/assets/script/game/hero/Hero.ts @@ -37,7 +37,7 @@ export class Hero extends ecs.Entity { /** 加载角色 */ - load(pos: Vec3 = Vec3.ZERO,scale:number = 1,uuid:number=1001,fight_pos:number=1) { + load(pos: Vec3 = Vec3.ZERO,scale:number = 1,uuid:number=1001,fight_pos:number=1,is_master:boolean=false) { // console.log("英雄加载:",uuid,pos,scale,info) scale = 1 // 查找空闲英雄槽位 @@ -72,7 +72,7 @@ export class Hero extends ecs.Entity { model.lv = hero.lv ? hero.lv : 1; model.type = hero.type; model.fac = FacSet.HERO; - model.is_master = true; + model.is_master = is_master; // ✅ 初始化技能数据(迁移到 HeroSkillsComp) skillsComp.initSkills(hero.skills, uuid, this); diff --git a/assets/script/game/map/MissionHeroComp.ts b/assets/script/game/map/MissionHeroComp.ts index 1f88e1f5..695448cb 100644 --- a/assets/script/game/map/MissionHeroComp.ts +++ b/assets/script/game/map/MissionHeroComp.ts @@ -42,7 +42,7 @@ export class MissionHeroCompComp extends CCComp { // this.current_hero_uuid=0 smc.vmdata.mission_data.hero_num=0 // console.log("[MissionHeroComp]:fight_ready",smc.fight_heros,Object.keys(smc.fight_heros).length) - this.addHero(smc.fight_hero,false) + this.addHero(smc.fight_hero,true) // for(let i=0;i(Hero); let scale = 1 let pos:Vec3 = HeroPos[hero_pos].pos; - hero.load(pos,scale,uuid); + let fight_pos=1 + + hero.load(pos,scale,uuid,fight_pos,is_master); }