soyoo-cocos/networks/mintegral.js

42 lines
1.1 KiB
JavaScript
Raw Normal View History

2024-12-05 21:14:41 +08:00
class SoyooLifecyle {
static Ready = 100 // 游戏初始化完成
static Start = 200 // 游戏正式开始
static Pause = 300 // 游戏暂停
static Resume = 400 // 游戏从暂停恢复
static Complete = 500 // 游戏结束, 全部完成
}
window.$soyooFacadeImpl = {
onLifecyleReport(lifecyle) {
switch(lifecyle) {
case SoyooLifecyle.Start:
window.gameReady && window.gameReady();
break;
case SoyooLifecyle.Complete:
window.gameEnd && window.gameEnd();
break;
default:
console.log("[SoyooFacadeImpl] not handled: ", lifecyle)
}
},
onGameInstall() {
window.install && window.install()
console.log("[SoyooFacadeImpl] onGameInstall")
}
}
!(function() {
let n = !1;
(window.gameStart = function() {
n
? window.resumeGame()
: ((n = !0), window.startGame());
}),
(window.gameClose = function() {
window.pauseGame();
}),
window.addEventListener("DOMContentLoaded", () => {
window.startGame()
})
})();