出生点修改
This commit is contained in:
@@ -8,6 +8,7 @@ import { GameEvent } from "../common/config/GameEvent";
|
||||
import { HeroModelComp } from "../hero/HeroModelComp";
|
||||
import { HeroViewComp } from "../hero/HeroViewComp";
|
||||
import { oops } from "db://oops-framework/core/Oops";
|
||||
import { HeroPos } from "../common/config/heroSet";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@@ -15,11 +16,6 @@ const { ccclass, property } = _decorator;
|
||||
@ecs.register('MissionHeroComp', false)
|
||||
export class MissionHeroCompComp extends CCComp {
|
||||
timer:Timer=new Timer(2)
|
||||
start_pos:any={
|
||||
0:{pos:v3(-50,0,0),has:false},
|
||||
1:{pos:v3(-170,205,0),has:false},
|
||||
2:{pos:v3(-170,65,0),has:false},
|
||||
}
|
||||
current_hero_uuid:number=0
|
||||
onLoad(){
|
||||
this.on(GameEvent.UseHeroCard,this.call_hero,this)
|
||||
@@ -33,9 +29,7 @@ export class MissionHeroCompComp extends CCComp {
|
||||
|
||||
}
|
||||
init(){
|
||||
this.start_pos[0].has=false
|
||||
this.start_pos[1].has=false
|
||||
this.start_pos[2].has=false
|
||||
|
||||
}
|
||||
test_call(){
|
||||
this.addHero(5010)
|
||||
@@ -92,15 +86,14 @@ export class MissionHeroCompComp extends CCComp {
|
||||
}
|
||||
|
||||
/** 添加英雄 */
|
||||
private addHero(uuid:number=1001,fight_pos:number=0) {
|
||||
private addHero(uuid:number=1001,freind_pos:number=0) {
|
||||
console.log("call_hero addHero",uuid)
|
||||
let info:any=this.get_info_and_remove(fight_pos,uuid)
|
||||
let info:any=this.get_info_and_remove(freind_pos,uuid)
|
||||
// let info:any={ap:0,hp:0,lv:0}
|
||||
let hero = ecs.getEntity<Hero>(Hero);
|
||||
let scale = 1
|
||||
let pos:Vec3 = this.start_pos[fight_pos].pos;
|
||||
// console.log("hero load0",pos,this.start_pos)
|
||||
hero.load(pos,scale,uuid,info,fight_pos);
|
||||
let pos:Vec3 = HeroPos[freind_pos].pos;
|
||||
hero.load(pos,scale,uuid,info,freind_pos);
|
||||
oops.message.dispatchEvent(GameEvent.HeroSelectEnd)
|
||||
this.current_hero_uuid=0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user