mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-10-09 00:26:11 +00:00
update
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import { resources } from "cc";
|
||||
import { BehaviorManager } from "../../extensions/Behavior Creator/runtime/main";
|
||||
import SystemBase from "../../extensions/ngame/assets/ngame/system/SystemBase";
|
||||
import JNSocket from "../../extensions/ngame/assets/ngame/network/JNSocket";
|
||||
import { JNSyncAction } from "../../extensions/ngame/assets/ngame/sync/JNSyncAction";
|
||||
import { JNSyncMessage } from "../../extensions/ngame/assets/ngame/sync/JNSyncMessage";
|
||||
@@ -8,10 +10,16 @@ import JNSyncFrameProtoComponent from "../../extensions/ngame/assets/ngame/sync/
|
||||
import JNLayer, { JNLayerAnim, JNLayerInfo } from "../../extensions/ngame/assets/ngame/ui/JNLayer";
|
||||
import JNLayerBase from "../../extensions/ngame/assets/ngame/ui/base/JNLayerBase";
|
||||
import { EventDispatcher } from "../../extensions/ngame/assets/ngame/util/EventDispatcher";
|
||||
import { JsonLoad, JsonUtil } from "../../extensions/ngame/assets/ngame/util/JsonUtil";
|
||||
import NGameMessage from "../../extensions/ngame/assets/ngame/util/NGameMessage";
|
||||
import axios from "../../extensions/ngame/assets/plugins/axios.js";
|
||||
import GBattleModeManager from "./battle/GBattleModeManager";
|
||||
import { GLayer, UIConfig } from "./ui/UIConfig";
|
||||
import JLoaderSystem from "../../extensions/ngame/assets/ngame/system/JLoaderSystem";
|
||||
import { TableGRole } from "../resources/config/ts/TableGRole";
|
||||
import loader from "../../extensions/ngame/assets/ngame/util/loader";
|
||||
import { Prefab } from "cc";
|
||||
import { sp } from "cc";
|
||||
|
||||
|
||||
//重写UI
|
||||
@@ -89,6 +97,47 @@ export abstract class JNGSyncProtoBase<T> extends JNSyncFrameProtoComponent<T>{
|
||||
|
||||
}
|
||||
|
||||
//读写config
|
||||
export class JNGConfig extends SystemBase{
|
||||
|
||||
//配置JSON加载
|
||||
jsons:JsonLoad[] = [
|
||||
{name:TableGRole.TableName},
|
||||
].map((table) => {
|
||||
return {
|
||||
name:table.name,
|
||||
bundle:"resources",
|
||||
path:"config/game/"
|
||||
}
|
||||
});
|
||||
|
||||
async onInit(): Promise<any> {
|
||||
for (const key in this.jsons) {
|
||||
const load = this.jsons[key];
|
||||
await JsonUtil.load(load);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//角色初始器
|
||||
export class JLoaderRole extends JLoaderSystem{
|
||||
|
||||
skData:{[id:number]:sp.SkeletonData} = {};
|
||||
async onInit(): Promise<any> {
|
||||
await super.onInit();
|
||||
//将配置表的角色都读取出来
|
||||
for (const info of Object.values(TableGRole.getAllConfig())) {
|
||||
this.skData[info.id] = await (new Promise(r => {
|
||||
this.bundle.load(info.spine,sp.SkeletonData,(err,data) => {
|
||||
r(data);
|
||||
})
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export const app = {
|
||||
layer : new JNGLayer(), //UI
|
||||
socket : new JNGSocket(), //Socket
|
||||
@@ -99,4 +148,6 @@ export const app = {
|
||||
baseURL: "http://localhost:8080",
|
||||
}), //请求
|
||||
battle : GBattleModeManager.getIns(), //战斗
|
||||
config : new JNGConfig(),
|
||||
role : new JLoaderRole("role"), //role包
|
||||
}
|
Reference in New Issue
Block a user