soyoo-cocos/networks/moloco.js

36 lines
944 B
JavaScript
Raw Permalink 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) {
default:
console.log("[SoyooFacadeImpl] not handled: ", lifecyle)
}
},
onGameInstall() {
FbPlayableAd && FbPlayableAd.onCTAClick();
console.log("[SoyooFacadeImpl] onGameInstall")
}
2024-12-09 18:08:19 +08:00
}
!(function() {
let n = !1;
(window.gameStart = function() {
n
? window.resumeGame()
: ((n = !0), window.startGame());
}),
(window.gameClose = function() {
window.pauseGame();
}),
window.addEventListener("DOMContentLoaded", () => {
window.startGame()
})
})();