application.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. System.register([], function (_export, _context) {
  2. "use strict";
  3. var cc, Application;
  4. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5. 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, descriptor.key, descriptor); } }
  6. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  7. return {
  8. setters: [],
  9. execute: function () {
  10. _export("Application", Application = /*#__PURE__*/function () {
  11. function Application() {
  12. _classCallCheck(this, Application);
  13. this.settingsPath = 'src/settings.json';
  14. this.effectSettingsPath = 'src/effect.bin';
  15. this.showFPS = false;
  16. }
  17. _createClass(Application, [{
  18. key: "init",
  19. value: function init(engine) {
  20. cc = engine;
  21. cc.game.onPostBaseInitDelegate.add(this.onPostInitBase.bind(this));
  22. cc.game.onPostSubsystemInitDelegate.add(this.onPostSystemInit.bind(this));
  23. }
  24. }, {
  25. key: "onPostInitBase",
  26. value: function onPostInitBase() {// cc.settings.overrideSettings('assets', 'server', '');
  27. // do custom logic
  28. }
  29. }, {
  30. key: "onPostSystemInit",
  31. value: function onPostSystemInit() {// do custom logic
  32. }
  33. }, {
  34. key: "start",
  35. value: function start() {
  36. return cc.game.init({
  37. debugMode: false ? cc.DebugMode.INFO : cc.DebugMode.ERROR,
  38. settingsPath: this.settingsPath,
  39. effectSettingsPath: this.effectSettingsPath,
  40. overrideSettings: {
  41. // assets: {
  42. // preloadBundles: [{ bundle: 'main', version: 'xxx' }],
  43. // }
  44. profiling: {
  45. showFPS: this.showFPS
  46. }
  47. }
  48. }).then(function () {
  49. return cc.game.run();
  50. });
  51. }
  52. }]);
  53. return Application;
  54. }());
  55. }
  56. };
  57. });