代码拉取完成,页面将自动刷新
import { Node } from "cc";
import Config, { config_get } from "./config/Config";
import Cryptor from "./encrypt/Cryptor";
import { Extension } from "./extension/Extension";
import Http from "./http/Http";
import LocalData from "./localData/LocalData";
import Logger, { LOG_LEVEL } from "./logger/Logger";
import { director } from "cc";
import { AudioManager } from "./audio/AudioManager";
Extension.Init();
export class SGame {
private static _inited: boolean = false;
public static get HasInited(): boolean {
return this._inited;
}
public static Init(config: object) {
if (this._inited) {
return;
}
this._inited = true;
let node = new Node("SGameManager");
node.addComponent(AudioManager);
director.addPersistRootNode(node);
Config.Init(config);
Logger.Init(config_get("logger.enable", true), config_get("logger.level", LOG_LEVEL.LOG));
Cryptor.Init(config_get("cryptor.key", ""), config_get("cryptor.iv", ""));
LocalData.Init(config_get("localData.enable", true), config_get("localData.key"), config_get("localData.iv"));
let httpConfig = (key: string, defaultVal: any = undefined) => {
return config_get("http." + key, defaultVal);
}
Http.Init(
httpConfig("timeout", 10000),
httpConfig("headers"),
httpConfig("responseType", "json"),
httpConfig("postContentType", "application/json")
);
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。