From 8016ec78f1b910112ed13581256975235925fc8d Mon Sep 17 00:00:00 2001 From: panfudan Date: Thu, 12 Jun 2025 20:48:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=BA=E7=94=9F=E7=82=B9=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/script/game/common/config/heroSet.ts | 10 +++++----- assets/script/game/map/MissionHeroComp.ts | 19 ++++++------------- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/assets/script/game/common/config/heroSet.ts b/assets/script/game/common/config/heroSet.ts index 9bd6a8b5..b20c8b1e 100644 --- a/assets/script/game/common/config/heroSet.ts +++ b/assets/script/game/common/config/heroSet.ts @@ -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:"说明"}, diff --git a/assets/script/game/map/MissionHeroComp.ts b/assets/script/game/map/MissionHeroComp.ts index 38ba5030..100bee59 100644 --- a/assets/script/game/map/MissionHeroComp.ts +++ b/assets/script/game/map/MissionHeroComp.ts @@ -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); 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 }