Files
heros/assets/script/Main.ts
2024-08-01 16:53:02 +08:00

47 lines
1.5 KiB
TypeScript

/*
* @Author: dgflash
* @Date: 2021-07-03 16:13:17
* @LastEditors: dgflash
* @LastEditTime: 2022-08-17 13:43:02
*/
import { profiler, _decorator ,PhysicsSystem2D} from 'cc';
import { DEBUG } from 'cc/env';
import { oops } from '../../extensions/oops-plugin-framework/assets/core/Oops';
import { Root } from '../../extensions/oops-plugin-framework/assets/core/Root';
import { ecs } from '../../extensions/oops-plugin-framework/assets/libs/ecs/ECS';
import { UIConfigData } from './game/common/config/GameUIConfig';
import { smc } from './game/common/SingletonModuleComp';
import { Initialize } from './game/initialize/Initialize';
const { ccclass, property } = _decorator;
@ccclass('Main')
export class Main extends Root {
start() {
if (DEBUG) profiler.showStats();
}
protected async run() {
smc.initialize = ecs.getEntity<Initialize>(Initialize);
smc.monsters = [
{prefab_path:'niu',name:'m1',speed:110},
// {prefab_path:'niu',name:'m2',speed:80},
// {prefab_path:'niu',name:'m3',speed:40},
// {prefab_path:'niu',name:'m4',speed:80},
]
smc.heros = [
{prefab_path:'niu',name:'war',speed:110},
// {prefab_path:'niu',name:'magic',speed:60},
// {prefab_path:'niu',name:'heath',speed:60},
// {prefab_path:'niu',name:'war',speed:60},
]
console.log("Game start");
}
protected initGui() {
oops.gui.init(UIConfigData);
}
protected initEcsSystem() {
}
}