application.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. System.register([], function (_export, _context) {
  2. "use strict";
  3. var Application, cc;
  4. _export("Application", void 0);
  5. return {
  6. setters: [],
  7. execute: function () {
  8. _export("Application", Application = class Application {
  9. constructor() {
  10. this.settingsPath = 'src/settings.json';
  11. this.showFPS = false;
  12. }
  13. init(engine) {
  14. cc = engine;
  15. cc.game.onPostBaseInitDelegate.add(this.onPostInitBase.bind(this));
  16. cc.game.onPostSubsystemInitDelegate.add(this.onPostSystemInit.bind(this));
  17. }
  18. onPostInitBase() {
  19. // cc.settings.overrideSettings('assets', 'server', '');
  20. // do custom logic
  21. }
  22. onPostSystemInit() {
  23. // do custom logic
  24. }
  25. start() {
  26. return cc.game.init({
  27. debugMode: false ? cc.DebugMode.INFO : cc.DebugMode.ERROR,
  28. settingsPath: this.settingsPath,
  29. overrideSettings: {
  30. // assets: {
  31. // preloadBundles: [{ bundle: 'main', version: 'xxx' }],
  32. // }
  33. profiling: {
  34. showFPS: this.showFPS
  35. }
  36. }
  37. }).then(() => cc.game.run());
  38. }
  39. });
  40. }
  41. };
  42. });