| 123456789101112131415161718192021222324252627282930313233343536 |
- const { ccclass } = cc._decorator;
- @ccclass
- export default class GameConst extends cc.Component {
- /**资源文件夹 */
- public static res_dirArr = ["game/config"];
- //OSS配置数据----------------------------------------------------------------
- /**关卡配置 */
- public static config_level: any = null;
- /**方块的icon index */
- public static iconIndex: number = 6;
- public static maxIconIndex: number = 2;
- //游戏数据------------------------------------------------------------------
- /**纵列 */
- public static col_num: number = 8;
- /**横列 */
- public static row_num: number = 8;
- /**加载配置 */
- public static loadConfig(): Promise<any> {
- return new Promise((resolve, reject) => {
- GameConst.res_dirArr.forEach(element => {
- cc.resources.loadDir(element, function (completedCount, totalCount, item) {
- // Loading.curloadedNum++;
- }, () => {
- GameConst.config_level = (cc.resources.get(`game/config/level`) as cc.JsonAsset).json;
- resolve(null);
- });
- });
- })
- }
- }
|