
                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/scripts/Game.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '65c1aiT6bVJ4bfXcq+jnmrf', 'Game');
// scripts/Game.ts

"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
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 });
var NpcManager_1 = require("./EVA_npc/NpcManager");
// 资源加载类
var ResLoaderManager_1 = require("./Manager/ResLoaderManager");
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var Game = /** @class */ (function (_super) {
    __extends(Game, _super);
    function Game() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        // npc 管理者
        _this.npcManager = null;
        _this.sm = null;
        //Test 引导
        _this.guideIndex = 0;
        return _this;
        // start() { }
        // update (dt) {}
    }
    // 初始化
    Game.prototype.init = function () {
        // 资源管理实例
        this.sm = ResLoaderManager_1.default.getInstance();
        // 获取NPC管理器实例
        this.npcManager = NpcManager_1.default.getInstance();
    };
    // 加载开始
    Game.prototype.load = function () {
        var _this = this;
        // 资源加载器
        var res = ResLoaderManager_1.default.getInstance();
        res.initJsonCfg(function (completedCount, totalCount) {
            if (completedCount === totalCount) {
                res.initPrefaRes(function (completedCount, totalCount) {
                    if (completedCount === totalCount) {
                        res.initSpriteAtlas(function (completedCount, totalCount) {
                            if (completedCount === totalCount) { // 加载完成
                                _this.loadOver();
                            }
                        });
                    }
                });
            }
        });
    };
    Game.prototype.loadOver = function () {
        // NPC管理器初始化自己所需的数据
        this.npcManager.init();
        // NPC管理器初始化数据完成后 开始创建NPC
        this.npcManager.npcStart();
    };
    Game.prototype.onLoad = function () {
        // 初始化程序
        this.init();
        this.load();
    };
    Game = __decorate([
        ccclass
    ], Game);
    return Game;
}(cc.Component));
exports.default = Game;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0c1xcc2NyaXB0c1xcR2FtZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSxtREFBOEM7QUFDOUMsUUFBUTtBQUNSLCtEQUEwRDtBQUVwRCxJQUFBLGtCQUFxQyxFQUFuQyxvQkFBTyxFQUFFLHNCQUEwQixDQUFDO0FBRzVDO0lBQWtDLHdCQUFZO0lBRDlDO1FBQUEscUVBd0RDO1FBckRDLFVBQVU7UUFDVixnQkFBVSxHQUFlLElBQUksQ0FBQTtRQUU3QixRQUFFLEdBQX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2VyLmdldEluc3RhbmNlKClcclxuICAgIC8vIOiOt+WPlk5QQ+euoeeQhuWZqOWunuS+i1xyXG4gICAgdGhpcy5ucGNNYW5hZ2VyID0gTnBjTWFuYWdlci5nZXRJbnN0YW5jZSgpXHJcbiAgfVxyXG5cclxuICAvLyDliqDovb3lvIDlp4tcclxuICBsb2FkKCkge1xyXG4gICAgLy8g6LWE5rqQ5Yqg6L295ZmoXHJcbiAgICBsZXQgcmVzID0gUmVzTG9hZGVyTWFuYWdlci5nZXRJbnN0YW5jZSgpXHJcbiAgICByZXMuaW5pdEpzb25DZmcoKGNvbXBsZXRlZENvdW50LCB0b3RhbENvdW50KSA9PiB7IC8vIOWKoOi9vemFjee9rui1hOa6kFxyXG4gICAgICBpZiAoY29tcGxldGVkQ291bnQgPT09IHRvdGFsQ291bnQpIHtcclxuICAgICAgICByZXMuaW5pdFByZWZhUmVzKChjb21wbGV0ZWRDb3VudCwgdG90YWxDb3VudCkgPT4geyAvLyDliqDovb3pooTliLbkvZPotYTmupBcclxuICAgICAgICAgIGlmIChjb21wbGV0ZWRDb3VudCA9PT0gdG90YWxDb3VudCkge1xyXG4gICAgICAgICAgICByZXMuaW5pdFNwcml0ZUF0bGFzKChjb21wbGV0ZWRDb3VudCwgdG90YWxDb3VudCkgPT4geyAvLyDliqDovb3lm77pm4botYTmupBcclxuICAgICAgICAgICAgICBpZiAoY29tcGxldGVkQ291bnQgPT09IHRvdGFsQ291bnQpIHsgLy8g5Yqg6L295a6M5oiQXHJcbiAgICAgICAgICAgICAgICB0aGlzLmxvYWRPdmVyKClcclxuICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICB9XHJcblxyXG4gICAgICAgIH0pXHJcbiAgICAgIH1cclxuICAgIH0pXHJcbiAgfVxyXG5cclxuICBsb2FkT3ZlcigpIHtcclxuICAgIC8vIE5QQ+euoeeQhuWZqOWIneWni+WMluiHquW3seaJgOmcgOeahOaVsOaNrlxyXG4gICAgdGhpcy5ucGNNYW5hZ2VyLmluaXQoKVxyXG4gICAgLy8gTlBD566h55CG5Zmo5Yid5aeL5YyW5pWw5o2u5a6M5oiQ5ZCOIOW8gOWni+WIm+W7uk5QQ1xyXG4gICAgdGhpcy5ucGNNYW5hZ2VyLm5wY1N0YXJ0KClcclxuICB9XHJcblxyXG5cclxuICBvbkxvYWQoKSB7XHJcbiAgICAvLyDliJ3lp4vljJbnqIvluo9cclxuICAgIHRoaXMuaW5pdCgpXHJcbiAgICB0aGlzLmxvYWQoKVxyXG4gIH1cclxuXHJcbiAgLy8gc3RhcnQoKSB7IH1cclxuXHJcbiAgLy8gdXBkYXRlIChkdCkge31cclxufSJdfQ==