WaterControl/library/imports/c5/c5692be7-8703-45e4-9f67-23b54d290356.js
2024-07-10 18:35:07 +08:00

131 lines
4.3 KiB
JavaScript

"use strict";
cc._RF.push(module, 'c5692vnhwNF5J9nI7VNKQNW', 'GameConfig');
// Script/module/Config/GameConfig.ts
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.GameConfig = void 0;
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var GameConfig = /** @class */ (function () {
function GameConfig() {
}
GameConfig_1 = GameConfig;
Object.defineProperty(GameConfig, "Instance", {
get: function () {
if (this._instance == null) {
this._instance = new GameConfig_1();
}
return this._instance;
},
enumerable: false,
configurable: true
});
GameConfig.init = function (Authentication) {
this.GM_INFO_init();
this.CLICK_init();
this.LEVEL_INFO_init();
// cc.resources.load('Json/GM_INFO', (err: any, res: cc.JsonAsset) => {
// if (err) {
// this.GM_INFO_init();
// if(!Authentication) this.Authentication();
// return;
// }
// let jsonData: object = res.json!;
// this.GM_INFO = jsonData["data"];
// if(!Authentication) this.Authentication();
// })
// cc.resources.load('Json/CLICK_DATA', (err: any, res: cc.JsonAsset) => {
// if (err) {
// this.CLICK_init();
// return;
// }
// let jsonData: object = res.json!;
// this.CLICK_DATA = jsonData["data"];
// })
// cc.resources.load('Json/LEVEL_INFO', (err: any, res: cc.JsonAsset) => {
// if (err) {
// this.LEVEL_INFO_init();
// return;
// }
// let jsonData: object = res.json!;
// this.LEVEL_INFO = jsonData["data"];
// })
//GAME_DATA 废弃了,暂时不删除以防后面修改回 一整局传一次
this.GAME_DATA = [];
};
//数据备用
GameConfig.GM_INFO_init = function () {
this.GM_INFO = {
// isEnd: false,
mean_Time: 0,
total: 0,
currSeed: 203213,
gameId: '100009',
userId: 0,
guide: true,
url: "http://api.sparkus.cn",
success: false,
matchId: null,
custom: 0 //用于测试跳关卡
};
};
GameConfig.CLICK_init = function () {
this.CLICK_DATA =
{
type: 1,
success: false,
round: 0,
totalSunCount: 0,
movedSunCount: 0,
sunSpeed: 0,
overlapSunCount: 0,
colorList: [],
duration: 0,
difficultyLevel: 0,
sunList: [],
stepTimeList: [],
remainder: 120 //游戏剩余时间
};
};
GameConfig.LEVEL_INFO_init = function () {
this.LEVEL_INFO = [
{
map: [
[
1, 0, 1, 1
],
[
1, 1, 1, 1
],
[
1, 1, 1, 1
],
[
1, 1, 1, 5
]
],
opacity: 0.9,
moveSpeed: 0.3,
}
];
};
GameConfig.Authentication = function () {
cc.fx.GameTool.Authentication();
};
var GameConfig_1;
//所有控制信息都通过GameAppStart内控制
GameConfig._instance = null;
GameConfig = GameConfig_1 = __decorate([
ccclass('GameConfig')
], GameConfig);
return GameConfig;
}());
exports.GameConfig = GameConfig;
cc._RF.pop();