dd
This commit is contained in:
@@ -10,6 +10,7 @@ import { Monster } from "../../monster/Monster";
|
||||
import { MapViewScene } from "./MapViewScene";
|
||||
import { Timer } from "../../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer";
|
||||
import { oops } from "../../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
import { CardSet } from "../../common/config/CardSet";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('MapViewComp')
|
||||
@@ -34,7 +35,8 @@ export class MapViewComp extends CCComp {
|
||||
this.addMonster()
|
||||
}
|
||||
private on_do_add_hero(event: string, args: any) {
|
||||
this.addHero()
|
||||
console.log("do_add_hero",args.HeroCardView)
|
||||
this.addHero(args.HeroCardView.card_uid)
|
||||
this.addMonster()
|
||||
|
||||
}
|
||||
@@ -74,18 +76,15 @@ export class MapViewComp extends CCComp {
|
||||
}
|
||||
}
|
||||
/** 添加玩家 */
|
||||
private addHero() {
|
||||
private addHero(uuid:number=1001) {
|
||||
this.scene.node.active = true
|
||||
if(smc.heros.length>0) {
|
||||
let hero = ecs.getEntity<Hero>(Hero);
|
||||
let pos = v3(BoxSet.HERO_START,BoxSet.GAME_LINE)
|
||||
let speed =smc.heros[0].speed
|
||||
let camp = 1
|
||||
let prefab_path = smc.heros[0].prefab_path
|
||||
let name = smc.heros[0].name
|
||||
hero.load(pos,speed,camp,prefab_path,name);
|
||||
smc.heros.splice(0,1)
|
||||
}
|
||||
let hero = ecs.getEntity<Hero>(Hero);
|
||||
let pos = v3(BoxSet.HERO_START,BoxSet.GAME_LINE)
|
||||
let speed =CardSet[uuid].speed
|
||||
let camp = 1
|
||||
let prefab_path = CardSet[uuid].prefab_path
|
||||
let name = CardSet[uuid].name
|
||||
hero.load(pos,speed,camp,prefab_path,name);
|
||||
}
|
||||
private addMonster() {
|
||||
this.scene.node.active = true
|
||||
|
||||
Reference in New Issue
Block a user