application.js 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. System.register([], function (_export, _context) {
  2. "use strict";
  3. var cc, Application;
  4. function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
  5. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
  7. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  8. function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
  9. function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
  10. return {
  11. setters: [],
  12. execute: function () {
  13. _export("Application", Application = /*#__PURE__*/function () {
  14. function Application() {
  15. _classCallCheck(this, Application);
  16. this.settingsPath = 'src/settings.json';
  17. this.showFPS = false;
  18. }
  19. _createClass(Application, [{
  20. key: "init",
  21. value: function init(engine) {
  22. cc = engine;
  23. cc.game.onPostBaseInitDelegate.add(this.onPostInitBase.bind(this));
  24. cc.game.onPostSubsystemInitDelegate.add(this.onPostSystemInit.bind(this));
  25. }
  26. }, {
  27. key: "onPostInitBase",
  28. value: function onPostInitBase() {
  29. // cc.settings.overrideSettings('assets', 'server', '');
  30. // do custom logic
  31. }
  32. }, {
  33. key: "onPostSystemInit",
  34. value: function onPostSystemInit() {
  35. // do custom logic
  36. }
  37. }, {
  38. key: "start",
  39. value: function start() {
  40. return cc.game.init({
  41. debugMode: false ? cc.DebugMode.INFO : cc.DebugMode.ERROR,
  42. settingsPath: this.settingsPath,
  43. overrideSettings: {
  44. // assets: {
  45. // preloadBundles: [{ bundle: 'main', version: 'xxx' }],
  46. // }
  47. profiling: {
  48. showFPS: this.showFPS
  49. }
  50. }
  51. }).then(function () {
  52. return cc.game.run();
  53. });
  54. }
  55. }]);
  56. return Application;
  57. }());
  58. }
  59. };
  60. });