出生点修改

This commit is contained in:
2025-06-12 20:48:11 +08:00
parent 741da016fd
commit 8016ec78f1
2 changed files with 11 additions and 18 deletions

View File

@@ -38,14 +38,14 @@ export const HeroSet = {
Start_y:[70,0,-70]
}
export const HeroPos={
0:{pos:v3(-140,130,0)},
1:{pos:v3(-220,130,0)},
2:{pos:v3(-300,130,0)},
0:{pos:v3(-140,0,0)},
1:{pos:v3(-220,0,0)},
2:{pos:v3(-300,0,0)},
}
export const MonSet = {
0:{pos:v3(320,0,0)},
1:{pos:v3(320,10,0)},
2:{pos:v3(320,-10,0)},
1:{pos:v3(320,15,0)},
2:{pos:v3(320,-15,0)},
}
export const HeroInfo = {
5001:{uuid:5001,name:"神圣守护",path:"k2", lv:3,kind:1,type:0,hp:50,ap:10,ap_u:0,ap_ur:0,hp_up:0,dis:700,a_cd:1,speed:50,skills:[6001],tals:"说明"},

View File

@@ -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
}