ddd
This commit is contained in:
@@ -3,7 +3,6 @@ import { ecs } from "../../../../../extensions/oops-plugin-framework/assets/libs
|
||||
import { CCComp } from "../../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
import { smc } from "../../common/SingletonModuleComp";
|
||||
import { Role } from "../../role/Role";
|
||||
import { Niu } from "../../monster/niu/Niu";
|
||||
import { BoxSet } from "../../common/config/BoxSet";
|
||||
import { Hero } from "../../heros/Hero";
|
||||
import { Monster } from "../../monster/Monster";
|
||||
@@ -58,27 +57,32 @@ export class MapViewComp extends CCComp {
|
||||
private addHero() {
|
||||
this.scene.node.active = true
|
||||
if (smc.monsters.length>0){
|
||||
this.addMonster(smc.monsters[0].name,smc.monsters[0].speed)
|
||||
let monster = ecs.getEntity<Monster>(Monster);
|
||||
let pos:Vec3 = v3(BoxSet.RIGHT_END,-60)
|
||||
let speed =smc.monsters[0].speed
|
||||
let camp = -1
|
||||
let prefab_path = smc.monsters[0].prefab_path
|
||||
let name = smc.monsters[0].name
|
||||
monster.load(pos,speed,camp,prefab_path,name);
|
||||
smc.monsters.splice(0,1)
|
||||
}
|
||||
// if(smc.heros.length>0) {
|
||||
// this.addMonster(smc.heros[0].name,100)
|
||||
// }
|
||||
|
||||
if(smc.heros.length>0) {
|
||||
console.log("heros load")
|
||||
let monster = ecs.getEntity<Monster>(Monster);
|
||||
let pos = v3(BoxSet.LETF_END,-60)
|
||||
let speed =smc.heros[0].speed
|
||||
let camp = 1
|
||||
let prefab_path = smc.heros[0].prefab_path
|
||||
let name = smc.heros[0].name
|
||||
monster.load(pos,speed,camp,prefab_path,name);
|
||||
smc.heros.splice(0,1)
|
||||
}
|
||||
}
|
||||
|
||||
private addMonster(name:string = "niu",speed:number = 100) {
|
||||
let monster = null
|
||||
switch (name) {
|
||||
case "niu":
|
||||
monster = ecs.getEntity<Niu>(Niu);
|
||||
break;
|
||||
case "hero":
|
||||
monster = ecs.getEntity<Monster>(Monster);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
monster.load(v3(BoxSet.RIGHT_END,-60),speed);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user