去掉hartmodel

This commit is contained in:
2025-06-06 16:26:13 +08:00
parent f9b3f56a04
commit fee9fc9852
7 changed files with 73 additions and 136 deletions

View File

@@ -7,7 +7,6 @@ import { HeroViewComp } from "./HeroViewComp";
import { BoxSet } from "../common/config/BoxSet";
import { HeroInfo } from "../common/config/heroSet";
import { BattleMoveComp } from "../common/ecs/position/BattleMoveComp";
import { HartModelComp } from "./HartModelComp";
import { SkillConComp } from "./SkillConComp";
/** 角色实体 */
@ecs.register(`Hero`)
@@ -29,10 +28,10 @@ export class Hero extends ecs.Entity {
this.remove(HeroModelComp);
super.destroy();
}
hart_load() {
hart_load(uuid:number=5001) {
console.log("主体加载")
let box_group=BoxSet.HERO
var path = "game/heros/hart";
var path = "game/heros/"+HeroInfo[uuid].path;
var prefab: Prefab = oops.res.get(path, Prefab)!;
var node = instantiate(prefab);
var scene = smc.map.MapView.scene;
@@ -40,24 +39,25 @@ export class Hero extends ecs.Entity {
let pos=v3(-277,0,0)
node.setPosition(pos)
var hv = node.getComponent(HeroViewComp)!;
let hero= HeroInfo[uuid] // 共用英雄数据
hv.scale = 1;
hv.fac = 0;
hv.type = 0;
hv.is_master=true;
hv.type = hero.type;
hv.box_group = box_group;
hv.hero_uuid= 9999;
hv.hero_name= "主体";
hv.speed =hv.ospeed = 0;
hv.dis = 0;
hv.hp= hv.hp_max =5;
hv.ap = 0;
hv.lv=0
hv.cd = 9999
hv.ap_u=0
hv.ap_ur=0
hv.hp_up=0
hv.atk_skill=0
hv.hero_uuid= uuid;
hv.hero_name= hero.name;
hv.speed =hv.ospeed = hero.speed;
hv.dis = hero.dis;
hv.hp= hv.hp_max =hero.hp;
hv.ap = hero.ap;
hv.lv=1
hv.cd = hero.a_cd
hv.ap_u=hero.ap_u
hv.ap_ur=hero.ap_ur
hv.hp_up=hero.hp_up
hv.atk_skill=hero.skills[0]
this.add(hv);
this.add(HartModelComp)
}
/** 加载角色 */
load(pos: Vec3 = Vec3.ZERO,scale:number = 1,uuid:number=1001,info:any={ap:0,hp:0},fight_pos:number=0) {