mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
38 lines
1.1 KiB
Plaintext
38 lines
1.1 KiB
Plaintext
<%- include(versionCheckTemplate, { version: '1.0.0'}) %>
|
|
let cc;
|
|
export class Application {
|
|
constructor () {
|
|
this.settingsPath = '<%= settingsJsonPath %>';
|
|
this.showFPS = <%= showFPS %>;
|
|
}
|
|
|
|
init (engine) {
|
|
cc = engine;
|
|
cc.game.onPostBaseInitDelegate.add(this.onPostInitBase.bind(this));
|
|
cc.game.onPostSubsystemInitDelegate.add(this.onPostSystemInit.bind(this));
|
|
}
|
|
|
|
onPostInitBase () {
|
|
// cc.settings.overrideSettings('assets', 'server', '');
|
|
// do custom logic
|
|
}
|
|
|
|
onPostSystemInit () {
|
|
// do custom logic
|
|
}
|
|
|
|
start () {
|
|
return cc.game.init({
|
|
debugMode: <%= debugMode %> ? cc.DebugMode.INFO : cc.DebugMode.ERROR,
|
|
settingsPath: this.settingsPath,
|
|
overrideSettings: {
|
|
// assets: {
|
|
// preloadBundles: [{ bundle: 'main', version: 'xxx' }],
|
|
// }
|
|
profiling: {
|
|
showFPS: this.showFPS,
|
|
}
|
|
}
|
|
}).then(() => cc.game.run());
|
|
}
|
|
} |