This commit is contained in:
2024-07-29 07:58:58 +08:00
parent 1c7240d914
commit 44005768a9
13 changed files with 416 additions and 32 deletions

View File

@@ -8,6 +8,7 @@ import { Hero } from "../../heros/Hero";
// import MapRoadUtils from "./map/road/MapRoadUtils";
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";
const { ccclass, property } = _decorator;
@ccclass('MapViewComp')
@@ -23,7 +24,13 @@ export class MapViewComp extends CCComp {
/** 转场碰撞点对象集合 */
private timer: Timer = new Timer(2);
onLoad(){
// 监听全局事件
oops.message.on("monster_load", this.onMonsterLoaded, this);
}
private onMonsterLoaded(event: string, args: any) {
console.log('on_monster_load', args);
}
reset(): void {
}
@@ -59,7 +66,8 @@ export class MapViewComp extends CCComp {
if (smc.monsters.length>0){
let monster = ecs.getEntity<Monster>(Monster);
monster.load(v3(360,-60));
monster.load(v3(360,-60),smc.monsters[0].speed);
monster.move(v3(0,-60));
smc.monsters.splice(0,1)
}