From c37024c3114114280ea866d4261e290782ea94a2 Mon Sep 17 00:00:00 2001
From: yityu <444546271@qq.com>
Date: Tue, 10 Dec 2024 17:26:45 +0800
Subject: [PATCH 1/3] Update single-html/loader-and-starter.js
---
single-html/loader-and-starter.js | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/single-html/loader-and-starter.js b/single-html/loader-and-starter.js
index a39a0cf..f7bb3f6 100644
--- a/single-html/loader-and-starter.js
+++ b/single-html/loader-and-starter.js
@@ -18,6 +18,8 @@ window.unmuteAudio = function() {
cc.audioEngine.resumeAll()
}
+window.registerLoad = false;
+
console.log("entry file loaded")
function b64ToUint6(nChr) {
@@ -69,7 +71,11 @@ function loadJson(item, _, callback) {
var assetMap = window.assetMap;
-setTimeout(() => {
+var registerInterval = setInterval(() => {
+ if (window.cc == undefined) {
+ return;
+ }
+ clearInterval(registerInterval);
cc.assetManager.downloader.register({
"bundle": function (item, _, callback) {
var bundleJsKey = Object.keys(assetMap).find(key => key.includes(item + "/index") && key.endsWith(".js"))
@@ -79,12 +85,12 @@ setTimeout(() => {
loadJs(bundleJsKey, _, (a1, data) => {
console.log("bundle js loaded:", bundleJsKey)
})
-
+
var bundleJsonKey = Object.keys(assetMap).find(key => key.includes(item + "/config") && key.endsWith(".json"))
if (!bundleJsonKey) {
console.error(`bundle ${item} not found`)
}
- loadJson(bundleJsonKey, _, (a1, data) =>
+ loadJson(bundleJsonKey, _, (a1, data) =>
{
var completeData = data;
completeData.base = "assets/" + item + "/"
@@ -126,7 +132,8 @@ setTimeout(() => {
)
},
})
-}, 10);
+ window.registerLoad = true;
+}, 16);
window.base122ToArrayBuffer = (e) => { const n = [0, 10, 13, 34, 38, 92], r = new Uint8Array(1.75 * e.length | 0); let t = 0, o = 0, f = 0; function s(e) { o |= (e <<= 1) >>> f, f += 7, f >= 8 && (r[t++] = o, f -= 8, o = e << 7 - f & 255) } for (let r = 0; r < e.length; r++) { const t = e.charCodeAt(r); if (t > 127) { const e = t >>> 8 & 7; 7 !== e && s(n[e]), s(127 & t) } else s(t) } return new Uint8Array(r.buffer, 0, t) }
From b11cdc13595bcf744d04824f09d705aa0d43e2bc Mon Sep 17 00:00:00 2001
From: yityu <444546271@qq.com>
Date: Tue, 10 Dec 2024 17:28:28 +0800
Subject: [PATCH 2/3] Update single-html/loader-and-starter.js
---
single-html/loader-and-starter.js | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/single-html/loader-and-starter.js b/single-html/loader-and-starter.js
index f7bb3f6..9203a48 100644
--- a/single-html/loader-and-starter.js
+++ b/single-html/loader-and-starter.js
@@ -1,5 +1,10 @@
window.startGame = function() {
- window.boot()
+ var startInterval = setInterval(() => {
+ if (window.registerLoad) {
+ window.boot();
+ clearInterval(startInterval);
+ }
+ }, 16)
}
window.pauseGame = function() {
From 9710219bf3c7748f4af2d4510ec3c957088a82ca Mon Sep 17 00:00:00 2001
From: guofei <1633295391@qq.com>
Date: Tue, 10 Dec 2024 22:42:41 +0800
Subject: [PATCH 3/3] 1
---
README.md | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index aa3a5b3..6a9b0ac 100644
--- a/README.md
+++ b/README.md
@@ -41,25 +41,33 @@ SoyooFacade.InstallGame()
0. 把目标目录web-mobile复制到soyoo-cocos目录下。
1. 删掉index.html里的js代码部分
2. 在body最后加上
-`
-`
+`
+
+
+
+
+`
## 渠道处理
### applovin
1. 把networks/applovin.js 复制到web-mobile下
2. 编辑复制的applovin.js, 在前几行填入对应的iosUrl和androidUrl
3. 编辑index.html,在body最后加上
-``
+`js
+
+`
### applovin
1. 把networks/mintegral.js 复制到web-mobile下
2. 编辑index.html,在body最后加上
-``
+`
+
+`
### moloco
1. 把`networks/moloco.js`复制到web-mobile目录下。
2. 编辑index.html,在body最后加上
-```
+```js
```