dd
This commit is contained in:
@@ -35,10 +35,12 @@ export class Monster extends ecs.Entity {
|
||||
let box_group=BoxSet.MONSTER
|
||||
console.log("mon load",uuid)
|
||||
// this.addComponents<ecs.Comp>( MonModelComp, BattleMoveComp);
|
||||
var scene = smc.map.MapView.scene;
|
||||
this.brith_light(pos,scene)
|
||||
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;
|
||||
|
||||
node.parent = scene.entityLayer!.node!
|
||||
const collider = node.getComponent(BoxCollider2D);
|
||||
if (collider) collider.enabled = false; // 先禁用 // 延迟一帧启用碰撞体
|
||||
@@ -51,7 +53,13 @@ export class Monster extends ecs.Entity {
|
||||
move.direction = -1; // 向左移动
|
||||
move.targetX = -800; // 左边界
|
||||
}
|
||||
|
||||
brith_light(pos:Vec3,scene:any){
|
||||
var path = "game/skills/map_birth";
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
var node = instantiate(prefab);
|
||||
node.parent = scene.entityLayer!.node!
|
||||
node.setPosition(pos)
|
||||
}
|
||||
hero_init(uuid:number=1001,node:Node,scale:number=1,box_group=BoxSet.HERO,is_boss:boolean=false,is_call:boolean=false,lv:number=1,rogueBuffData?: any[]) {
|
||||
var hv = node.getComponent(HeroViewComp)!;
|
||||
hv.hide_info()
|
||||
|
||||
Reference in New Issue
Block a user