monter 和hero Entity 分开

This commit is contained in:
panw
2024-12-12 15:36:09 +08:00
parent dde5954d5c
commit 4e41d5a103
3 changed files with 137 additions and 2 deletions

View File

@@ -25,6 +25,7 @@ import { HCardComp } from "./HCardComp";
import { VictoryComp } from "./VictoryComp";
import { ItemComp } from "./ItemComp";
import { MSkillComp } from "./MSkillComp";
import { Monster } from "../hero/Mon";
const { ccclass, property } = _decorator;
/** 视图层对象 */
@@ -232,11 +233,11 @@ export class MissionComp extends CCComp {
hero.load(pos,scale,uuid);
}
private addMonster(uuid:number=1001,i:number=0) {
let monster = ecs.getEntity<Hero>(Hero);
let mon = ecs.getEntity<Monster>(Monster);
let scale = -1
let pos:Vec3 = v3(-1*HeroSet.StartPos[HeroInfo[uuid].type]+i*15,BoxSet.GAME_LINE);
console.log("addMonster:",pos)
monster.load(pos,scale,uuid,false);
mon.load(pos,scale,uuid,false);
}