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

@@ -11,6 +11,9 @@ import { AsyncQueue, NextFunction } from "../../../../extensions/oops-plugin-fra
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { UIID } from "../common/config/GameUIConfig";
import { LoadingViewComp } from "./view/LoadingViewComp";
import { smc } from "../common/SingletonModuleComp";
import { HeroList } from "../map/HeroList";
// import {data} from "../data/data";
/**
* 游戏进入初始化模块
@@ -20,6 +23,7 @@ import { LoadingViewComp } from "./view/LoadingViewComp";
@ecs.register(`Initialize`)
export class Initialize extends ecs.Entity {
LoadingView!: LoadingViewComp;
HeroList: HeroList;
// data:data=null!;
protected init() {
@@ -44,6 +48,9 @@ export class Initialize extends ecs.Entity {
queue.push(async (next: NextFunction, params: any, args: any) => {
// 加载多语言对应字体
oops.res.load("language/font/" + oops.language.current, next);
//加载精灵配置表
oops.res.load("config/game/heros", next);
});
}
@@ -77,6 +84,10 @@ export class Initialize extends ecs.Entity {
/** 加载完成进入游戏内容加载界面 */
private onComplete(queue: AsyncQueue) {
queue.complete = () => {
this.HeroList = new HeroList();
this.HeroList.init(); // 等待数据加载完成
smc.heros = this.HeroList.list;
var uic: UICallbacks = {
onAdded: (node: Node, params: any) => {
var comp = node.getComponent(LoadingViewComp) as ecs.Comp;