This commit is contained in:
2024-08-12 17:16:39 +08:00
parent dedc020bbd
commit 825457fd0e
28 changed files with 766 additions and 383 deletions

View File

@@ -60,7 +60,10 @@ export class MapViewComp extends CCComp {
this.gold_add(dt)
}
monster_refresh(){
this.addMonster(1001)
if(smc.monsters.length > 0 ){
this.addMonster(smc.monsters[0].uuid)
}
}
gold_add(dt: number) {
smc.vm_data.gold.time += dt;
@@ -88,10 +91,11 @@ export class MapViewComp extends CCComp {
}
private addMonster(uuid:number=1001) {
this.scene.node.active = true
let monster = ecs.getEntity<Monster>(Monster);
let pos:Vec3 = v3(BoxSet.MONSTER_START,BoxSet.GAME_LINE)
let camp = -1
monster.load(pos,camp,uuid);
let monster = ecs.getEntity<Monster>(Monster);
let pos:Vec3 = v3(BoxSet.MONSTER_START,BoxSet.GAME_LINE)
let camp = -1
monster.load(pos,camp,uuid);
smc.monsters.splice(0,1)
}