This commit is contained in:
pan
2024-08-19 17:27:31 +08:00
parent 8f57f57c1d
commit 3994ba359a
14 changed files with 1081 additions and 524 deletions

View File

@@ -1,4 +1,4 @@
import { v3, Vec3, _decorator ,Prefab,instantiate} from "cc";
import { v3, Vec3, _decorator ,Prefab,instantiate,JsonAsset} from "cc";
import { ecs } from "../../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { CCComp } from "../../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
import { smc } from "../../common/SingletonModuleComp";
@@ -11,29 +11,27 @@ 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')
@ecs.register('MapView', false)
export class MapViewComp extends CCComp {
scene: MapViewScene = null!;
/** 是否正在转场 */
/** 当前地图数据 */
current_map: any;
/** 转场碰撞点对象集合 */
private game_timer: Timer = new Timer(1);
private monster_refresh_rtimer: Timer = new Timer(3);
private mapLoaded() {
}
onLoad(){
async onLoad(){
// 监听全局事件
oops.message.on("do_add_monster", this.on_do_add_monster, this);
oops.message.on("do_add_hero", this.on_do_add_hero, this);
}
private on_do_add_monster(event: string, args: any) {
this.addMonster()
@@ -49,9 +47,12 @@ export class MapViewComp extends CCComp {
start() {
this.scene = this.getComponent(MapViewScene);
this.load_data()
}
load_data(){
// let heros = oops.res.get("config/game/heros")
// console.log("heros",heros)
}
protected update(dt: number): void {
if (this.monster_refresh_rtimer.update(dt)) {
this.monster_refresh()