Compare commits

...

2 Commits

Author SHA1 Message Date
Evan
4fc07b1458 Merge branch 'main' of https://git.tianfurunhe.com/lyf/001code-html--cocos
# Conflicts:
#	scratch-gui/src/playground/config.js
#	scratch-gui/static/unity/Build/mstest5.loader.js
#	scratch-gui/static/unity/StreamingAssets/aa/WebGL/defaultlocalgroup_scenes_all_44c83ead579edde0422cd5707e20fce8.bundle.br
#	scratch-gui/static/unity/StreamingAssets/aa/catalog.json
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/91601-91700.json
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/91601-91700.json.br
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/91701-91800.json
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/91701-91800.json.br
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/91801-91900.json
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/91801-91900.json.br
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/91901-92000.json
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/91901-92000.json.br
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/92001-92100.json
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/92001-92100.json.br
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/92101-92200.json
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/92101-92200.json.br
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/92201-92300.json
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/92201-92300.json.br
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/92301-92400.json
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/92301-92400.json.br
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/92401-92500.json
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/92401-92500.json.br
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/92501-92600.json
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/92501-92600.json.br
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/92601-92700.json
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/92601-92700.json.br
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/92701-92800.json
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/92701-92800.json.br
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/92801-92900.json
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/92801-92900.json.br
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/92901-93000.json
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/92901-93000.json.br
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/93001-93100.json
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/93001-93100.json.br
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/93101-93200.json
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/93101-93200.json.br
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/93201-93300.json
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/93201-93300.json.br
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/93301-93400.json
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/93301-93400.json.br
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/93401-93500.json
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/93401-93500.json.br
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/93501-93600.json
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/93501-93600.json.br
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/93601-93700.json
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/93601-93700.json.br
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/93701-93800.json
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/93701-93800.json.br
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/93801-93900.json
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/93801-93900.json.br
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/93901-94000.json
#	scratch-gui/static/unity/StreamingAssets/aa/levels-db/93901-94000.json.br
#	scratch-gui/static/unity/StreamingAssets/aa/levels-manifest.json
#	scratch-gui/static/unity/StreamingAssets/aa/settings.json
#	scratch-gui/static/unity/levels-database.json
#	scratch-gui/static/unity/levels-database.json.br
#	scratch-gui/static/unity/levels-db-index.json
#	scratch-gui/static/unity/levels-db-index.json.br
2026-07-17 17:29:53 +08:00
Evan
3bafb1e10d cocos 2026-07-17 17:19:24 +08:00
2502 changed files with 1222 additions and 38 deletions

View File

@@ -164,7 +164,7 @@ const CONFIG = {
// DataServerBaseUrl: "https://test.server.001code.com",
// DataServerBaseUrl: "https://test.server.001code.com",
version: "20260520",
version: "20260717",
/** OSS 真实地址(生产环境浏览器直连) */
unityCdnRemote: 'https://oss.eanic.cn/001_code_cocos_res_20260617',
@@ -174,8 +174,8 @@ const CONFIG = {
unityCdnUseDevProxy: false,
/** 生产 nginx 反向代理 OSS 同路径时设为 true方案 B */
unityCdnUseSiteProxy: false,
unitycdndir: 'https://oss.eanic.cn/001_code_cocos_res_20260617',
unitycdnbuilddir: 'https://oss.eanic.cn/001_code_cocos_res_20260617/Build',
unitycdndir: 'https://oss.eanic.cn/001_code_cocos_res_20260717',
unitycdnbuilddir: 'https://oss.eanic.cn/001_code_cocos_res_20260717/Build',
python_pyodide_cdn_dir: 'https://oss.eanic.cn/001_code_python_res_20241213/pyodide/',
// 可以根据需要添加其他配置

View File

@@ -0,0 +1,288 @@
// config.js
// const CONFIG = {
// DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址
// // DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址
// // DataServerBaseUrl: "https://test.server.001code.com",
// // DataServerBaseUrl: "https://test.server.001code.com",
// // DataServerBaseUrl: "https://test.server.001code.com",
// // DataServerBaseUrl: "https://test.server.001code.com",
// version : "2025010301",
// unitycdndir : 'https://oss-rpwqy.jjwlcdn.com/001_code_unity_res_20250826',
// unitycdnbuilddir : 'https://oss-rpwqy.jjwlcdn.com/001_code_unity_res_20250826/Build',
// python_pyodide_cdn_dir : 'https://oss-rpwqy.jjwlcdn.com/001_code_python_res_20241213/pyodide/',
// // 可以根据需要添加其他配置
// disabledev: false,
// usecdn :true, //资源走CDN
// lvlock :false, //关卡5关解锁,下一关加锁
// lvlock_normal_learn :true, //常规关起锁
// lockupdate :false, //上传按钮
// mactchlv : false, //比赛关卡
// learnvideo : true,
// gameNumber:150,
// SSN_COMPETITION_ID: [13],
// // 计算关卡实际id
// getRealLvId(gamelv,gameid, ismatch, gameNumber){
// if(localStorage.getItem('platformMode') === 'competition'){
// return parseInt(window.unity_game_number, 10)
// }else{
// if (!ismatch){
// return ((gamelv-1)*20*gameNumber)+((gameid-1)*gameNumber)
// }else{
// //TODO 这里维护一张匹配关卡映射表
// if (gamelv === 240896 && gameid === 0) {
// return 10000;
// }
// }
// }
// },
// lastGameStyle: '',
// lastGameDefaultSkin: 0,
// checkGameStyle(realLvId){
// let gameStyle = '';
// let gameDefaultSkin = 0;
// if ((realLvId >= 1 && realLvId <= 400) || (realLvId >= 20001 && realLvId <= 30000)) {
// gameStyle = 'default';
// gameDefaultSkin = 0;
// } else if ((realLvId >= 401 && realLvId <= 800) || (realLvId >= 10001 && realLvId <= 20000)) {
// gameStyle = 'chinese';
// gameDefaultSkin = 1;
// } else if ((realLvId >= 801 && realLvId <= 1200) || (realLvId >= 40001 && realLvId <= 50000)) {
// gameStyle = 'redArmy';
// gameDefaultSkin = 2;
// } else if ((realLvId >= 1201 && realLvId <= 1600) || (realLvId >= 30001 && realLvId <= 40000)) {
// gameStyle = 'numMan';
// gameDefaultSkin = 3;
// }else {
// gameStyle = 'default';
// gameDefaultSkin = 0;
// }
// if (gameStyle !== this.lastGameStyle) {
// window.unityInstance.SendMessage("GameController", "ChangeUIStyle", gameStyle);
// this.lastGameStyle = gameStyle;
// }
// if (gameDefaultSkin !== this.lastGameDefaultSkin) {
// setTimeout(() => {
// window.unityInstance.SendMessage("Player", "CallChangeSkin", gameDefaultSkin);
// console.log("CallChangeSkin >>> ", gameDefaultSkin);
// }, 3000);
// this.lastGameDefaultSkin = gameDefaultSkin;
// }
// }
// };
// const CONFIG = {
// // DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址
// // DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址
// // DataServerBaseUrl: "https://test.server.001code.com",
// DataServerBaseUrl: "https://test.server.001code.com",
// // DataServerBaseUrl: "https://test.server.001code.com",
// // DataServerBaseUrl: "https://test.server.001code.com",
// version : "2025011001",
// unitycdndir : 'https://oss-rpwqy.jjwlcdn.com/001_code_unity_res_20250826',
// unitycdnbuilddir : 'https://oss-rpwqy.jjwlcdn.com/001_code_unity_res_20250826/Build',
// python_pyodide_cdn_dir : 'https://oss-rpwqy.jjwlcdn.com/001_code_python_res_20241213/pyodide/',
// // 可以根据需要添加其他配置
// // disabledev: false,
// disabledev: false,
// usecdn :true, //资源走CDN
// lvlock :false, //关卡5关解锁,下一关加锁
// lvlock_normal_learn : !(typeof localStorage !== 'undefined' &&
// (localStorage.getItem('player_id') === '32' || localStorage.getItem('player_id') === '1506'|| localStorage.getItem('player_id') === '24'|| localStorage.getItem('player_id') === '1550')), //常规关起锁
// lockupdate :false, //上传按钮
// mactchlv : false, //比赛关卡
// learnvideo : true,
// gameNumber:120,
// // 计算关卡实际id
// SSN_COMPETITION_ID: [21,22,23],
// getRealLvId(gamelv,gameid, ismatch, gameNumber){
// if(localStorage.getItem('platformMode') === 'competition'){
// return parseInt(window.unity_game_number, 10)
// }else{
// if (!ismatch){
// return ((gamelv-1)*20*gameNumber)+((gameid-1)*gameNumber)
// }else{
// //TODO 这里维护一张匹配关卡映射表
// if (gamelv === 240896 && gameid === 0) {
// return 10000;
// }
// }
// }
// },
// lastGameStyle: '',
// lastGameDefaultSkin: 0,
// checkGameStyle(realLvId){
// let gameStyle = '';
// let gameDefaultSkin = 0;
// if ((realLvId >= 1 && realLvId <= 400) || (realLvId >= 20001 && realLvId <= 30000)) {
// gameStyle = 'default';
// gameDefaultSkin = 0;
// } else if ((realLvId >= 401 && realLvId <= 800) || (realLvId >= 10001 && realLvId <= 20000)) {
// gameStyle = 'chinese';
// gameDefaultSkin = 1;
// } else if ((realLvId >= 801 && realLvId <= 1200) || (realLvId >= 40001 && realLvId <= 50000)) {
// gameStyle = 'redArmy';
// gameDefaultSkin = 2;
// } else if ((realLvId >= 1201 && realLvId <= 1600) || (realLvId >= 30001 && realLvId <= 40000)) {
// gameStyle = 'numMan';
// gameDefaultSkin = 3;
// }else {
// gameStyle = 'default';
// gameDefaultSkin = 0;
// }
// if (gameStyle !== this.lastGameStyle) {
// window.unityInstance.SendMessage("GameController", "ChangeUIStyle", gameStyle);
// this.lastGameStyle = gameStyle;
// }
// if (gameDefaultSkin !== this.lastGameDefaultSkin) {
// setTimeout(() => {
// window.unityInstance.SendMessage("Player", "CallChangeSkin", gameDefaultSkin);
// console.log("CallChangeSkin >>> ", gameDefaultSkin);
// }, 3000);
// this.lastGameDefaultSkin = gameDefaultSkin;
// }
// }
// };
const CONFIG = {
// DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址
// DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址
// DataServerBaseUrl: "https://test.server.001code.com",
DataServerBaseUrl: "https://test.server.001code.com",
// DataServerBaseUrl: "https://test.server.001code.com",
// DataServerBaseUrl: "https://test.server.001code.com",
version: "20260717",
/** OSS 真实地址(生产环境浏览器直连) */
unityCdnRemote: 'https://oss.eanic.cn/001_code_cocos_res_20260617',
/** 方案 Bnginx / webpack 同源代理前缀(方案 A 直连 OSS 请保持 false */
unityCdnDevProxy: '/cdn-unity',
/** 本地 npm start 也走代理(仅 unityCdnUseSiteProxy 或此项为 true 时生效) */
unityCdnUseDevProxy: false,
/** 生产 nginx 反向代理 OSS 同路径时设为 true方案 B */
unityCdnUseSiteProxy: false,
<<<<<<< HEAD
unitycdndir: 'https://oss.eanic.cn/001_code_cocos_res_20260717',
unitycdnbuilddir: 'https://oss.eanic.cn/001_code_cocos_res_20260717/Build',
=======
unitycdndir: 'https://oss.eanic.cn/001_code_cocos_res_20260617',
unitycdnbuilddir: 'https://oss.eanic.cn/001_code_cocos_res_20260617/Build',
>>>>>>> b08562d603e88576042ff972dedf771c32224b4b
python_pyodide_cdn_dir: 'https://oss.eanic.cn/001_code_python_res_20241213/pyodide/',
// 可以根据需要添加其他配置
disabledev: false,
usecdn: true,
lvlock: false,
lvlock_normal_learn: !(typeof localStorage !== 'undefined' &&
(localStorage.getItem('player_id') === '37' || localStorage.getItem('player_id') === '45' || localStorage.getItem('player_id') === '55')),
lockupdate: false,
mactchlv: false,
learnvideo: true,
gameNumber: 120,
//计算关卡实际id
SSN_COMPETITION_ID: [13],
NOT_ALLOWED_COMPETITION_ID: [72, 62, 64, 65, 69, 61, 63, 67, 70, 74, 73, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84],
BEGINNING_REAL_LVID: 91600,
END_REAL_LVID: 93100,
SIMULATE_COMPETITION_ID: [149], // 用于测试的模拟比赛ID
HIDE_COMPETITION_TIME_ID: [154, 155, 156], // 需要隐藏比赛时间的比赛ID列表
// 计算关卡实际id
getRealLvId(gamelv, gameid, ismatch, gameNumber) {
if (localStorage.getItem('platformMode') === 'competition') {
return parseInt(window.unity_game_number, 10)
} else {
if (!ismatch) {
return ((gamelv - 1) * 30 * gameNumber) + ((gameid - 1) * gameNumber) + this.BEGINNING_REAL_LVID
} else {
//TODO 这里维护一张匹配关卡映射表
if (gamelv === 240896 && gameid === 0) {
return 10000;
}
}
}
},
lastGameStyle: '',
lastGameDefaultSkin: 0,
checkGameStyle(realLvId) {
let gameStyle = 'SILU';
let gameDefaultSkin = 0;
if (realLvId >= this.BEGINNING_REAL_LVID && realLvId <= this.END_REAL_LVID) {
realLvId = realLvId - this.BEGINNING_REAL_LVID;
if (realLvId >= 1 && realLvId <= 300) {
gameStyle = 'SILU';
gameDefaultSkin = 0;
} else if (realLvId >= 301 && realLvId <= 600) {
gameStyle = 'redArmy';
gameDefaultSkin = 2;
} else if (realLvId >= 601 && realLvId <= 900) {
gameStyle = 'numMan';
gameDefaultSkin = 3;
} else if (realLvId >= 901 && realLvId <= 1200) {
gameStyle = 'chinese';
gameDefaultSkin = 1;
} else if (realLvId >= 1201 && realLvId <= 1500) {
gameStyle = 'snow';
gameDefaultSkin = 4;
} else if (realLvId >= 1501 && realLvId <= 1800) {
gameStyle = 'SILU';
gameDefaultSkin = 0;
} else {
gameStyle = 'SILU';
gameDefaultSkin = 0;
}
}
if (gameStyle !== this.lastGameStyle) {
window.unityInstance.SendMessage("GameController", "ChangeUIStyle", gameStyle);
this.lastGameStyle = gameStyle;
}
// 尝试多次发送消息,以确保 Unity 场景和 Player 对象已加载
if (gameDefaultSkin !== this.lastGameDefaultSkin) {
// 尝试多次发送消息,以确保 Unity 场景和 Player 对象已加载
const sendSkinMsg = (delay) => {
setTimeout(() => {
if (window.unityInstance) {
try {
window.unityInstance.SendMessage("Player", "CallChangeSkin", gameDefaultSkin);
console.log("CallChangeSkin sent >>> ", gameDefaultSkin);
} catch (e) {
console.log("Player not ready yet");
}
}
}, delay);
};
sendSkinMsg(2000);
sendSkinMsg(4000);
sendSkinMsg(6000);
this.lastGameDefaultSkin = gameDefaultSkin;
}
}
};
export default CONFIG;

View File

@@ -0,0 +1,283 @@
// config.js
// const CONFIG = {
// DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址
// // DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址
// // DataServerBaseUrl: "https://test.server.001code.com",
// // DataServerBaseUrl: "https://test.server.001code.com",
// // DataServerBaseUrl: "https://test.server.001code.com",
// // DataServerBaseUrl: "https://test.server.001code.com",
// version : "2025010301",
// unitycdndir : 'https://oss-rpwqy.jjwlcdn.com/001_code_unity_res_20250826',
// unitycdnbuilddir : 'https://oss-rpwqy.jjwlcdn.com/001_code_unity_res_20250826/Build',
// python_pyodide_cdn_dir : 'https://oss-rpwqy.jjwlcdn.com/001_code_python_res_20241213/pyodide/',
// // 可以根据需要添加其他配置
// disabledev: false,
// usecdn :true, //资源走CDN
// lvlock :false, //关卡5关解锁,下一关加锁
// lvlock_normal_learn :true, //常规关起锁
// lockupdate :false, //上传按钮
// mactchlv : false, //比赛关卡
// learnvideo : true,
// gameNumber:150,
// SSN_COMPETITION_ID: [13],
// // 计算关卡实际id
// getRealLvId(gamelv,gameid, ismatch, gameNumber){
// if(localStorage.getItem('platformMode') === 'competition'){
// return parseInt(window.unity_game_number, 10)
// }else{
// if (!ismatch){
// return ((gamelv-1)*20*gameNumber)+((gameid-1)*gameNumber)
// }else{
// //TODO 这里维护一张匹配关卡映射表
// if (gamelv === 240896 && gameid === 0) {
// return 10000;
// }
// }
// }
// },
// lastGameStyle: '',
// lastGameDefaultSkin: 0,
// checkGameStyle(realLvId){
// let gameStyle = '';
// let gameDefaultSkin = 0;
// if ((realLvId >= 1 && realLvId <= 400) || (realLvId >= 20001 && realLvId <= 30000)) {
// gameStyle = 'default';
// gameDefaultSkin = 0;
// } else if ((realLvId >= 401 && realLvId <= 800) || (realLvId >= 10001 && realLvId <= 20000)) {
// gameStyle = 'chinese';
// gameDefaultSkin = 1;
// } else if ((realLvId >= 801 && realLvId <= 1200) || (realLvId >= 40001 && realLvId <= 50000)) {
// gameStyle = 'redArmy';
// gameDefaultSkin = 2;
// } else if ((realLvId >= 1201 && realLvId <= 1600) || (realLvId >= 30001 && realLvId <= 40000)) {
// gameStyle = 'numMan';
// gameDefaultSkin = 3;
// }else {
// gameStyle = 'default';
// gameDefaultSkin = 0;
// }
// if (gameStyle !== this.lastGameStyle) {
// window.unityInstance.SendMessage("GameController", "ChangeUIStyle", gameStyle);
// this.lastGameStyle = gameStyle;
// }
// if (gameDefaultSkin !== this.lastGameDefaultSkin) {
// setTimeout(() => {
// window.unityInstance.SendMessage("Player", "CallChangeSkin", gameDefaultSkin);
// console.log("CallChangeSkin >>> ", gameDefaultSkin);
// }, 3000);
// this.lastGameDefaultSkin = gameDefaultSkin;
// }
// }
// };
// const CONFIG = {
// // DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址
// // DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址
// // DataServerBaseUrl: "https://test.server.001code.com",
// DataServerBaseUrl: "https://test.server.001code.com",
// // DataServerBaseUrl: "https://test.server.001code.com",
// // DataServerBaseUrl: "https://test.server.001code.com",
// version : "2025011001",
// unitycdndir : 'https://oss-rpwqy.jjwlcdn.com/001_code_unity_res_20250826',
// unitycdnbuilddir : 'https://oss-rpwqy.jjwlcdn.com/001_code_unity_res_20250826/Build',
// python_pyodide_cdn_dir : 'https://oss-rpwqy.jjwlcdn.com/001_code_python_res_20241213/pyodide/',
// // 可以根据需要添加其他配置
// // disabledev: false,
// disabledev: false,
// usecdn :true, //资源走CDN
// lvlock :false, //关卡5关解锁,下一关加锁
// lvlock_normal_learn : !(typeof localStorage !== 'undefined' &&
// (localStorage.getItem('player_id') === '32' || localStorage.getItem('player_id') === '1506'|| localStorage.getItem('player_id') === '24'|| localStorage.getItem('player_id') === '1550')), //常规关起锁
// lockupdate :false, //上传按钮
// mactchlv : false, //比赛关卡
// learnvideo : true,
// gameNumber:120,
// // 计算关卡实际id
// SSN_COMPETITION_ID: [21,22,23],
// getRealLvId(gamelv,gameid, ismatch, gameNumber){
// if(localStorage.getItem('platformMode') === 'competition'){
// return parseInt(window.unity_game_number, 10)
// }else{
// if (!ismatch){
// return ((gamelv-1)*20*gameNumber)+((gameid-1)*gameNumber)
// }else{
// //TODO 这里维护一张匹配关卡映射表
// if (gamelv === 240896 && gameid === 0) {
// return 10000;
// }
// }
// }
// },
// lastGameStyle: '',
// lastGameDefaultSkin: 0,
// checkGameStyle(realLvId){
// let gameStyle = '';
// let gameDefaultSkin = 0;
// if ((realLvId >= 1 && realLvId <= 400) || (realLvId >= 20001 && realLvId <= 30000)) {
// gameStyle = 'default';
// gameDefaultSkin = 0;
// } else if ((realLvId >= 401 && realLvId <= 800) || (realLvId >= 10001 && realLvId <= 20000)) {
// gameStyle = 'chinese';
// gameDefaultSkin = 1;
// } else if ((realLvId >= 801 && realLvId <= 1200) || (realLvId >= 40001 && realLvId <= 50000)) {
// gameStyle = 'redArmy';
// gameDefaultSkin = 2;
// } else if ((realLvId >= 1201 && realLvId <= 1600) || (realLvId >= 30001 && realLvId <= 40000)) {
// gameStyle = 'numMan';
// gameDefaultSkin = 3;
// }else {
// gameStyle = 'default';
// gameDefaultSkin = 0;
// }
// if (gameStyle !== this.lastGameStyle) {
// window.unityInstance.SendMessage("GameController", "ChangeUIStyle", gameStyle);
// this.lastGameStyle = gameStyle;
// }
// if (gameDefaultSkin !== this.lastGameDefaultSkin) {
// setTimeout(() => {
// window.unityInstance.SendMessage("Player", "CallChangeSkin", gameDefaultSkin);
// console.log("CallChangeSkin >>> ", gameDefaultSkin);
// }, 3000);
// this.lastGameDefaultSkin = gameDefaultSkin;
// }
// }
// };
const CONFIG = {
// DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址
// DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址
// DataServerBaseUrl: "https://test.server.001code.com",
DataServerBaseUrl: "https://test.server.001code.com",
// DataServerBaseUrl: "https://test.server.001code.com",
// DataServerBaseUrl: "https://test.server.001code.com",
version: "20260520",
/** OSS 真实地址(生产环境浏览器直连) */
unityCdnRemote: 'https://oss.eanic.cn/001_code_cocos_res_20260616',
/** 方案 Bnginx / webpack 同源代理前缀(方案 A 直连 OSS 请保持 false */
unityCdnDevProxy: '/cdn-unity',
/** 本地 npm start 也走代理(仅 unityCdnUseSiteProxy 或此项为 true 时生效) */
unityCdnUseDevProxy: false,
/** 生产 nginx 反向代理 OSS 同路径时设为 true方案 B */
unityCdnUseSiteProxy: false,
unitycdndir: 'https://oss.eanic.cn/001_code_cocos_res_20260616',
unitycdnbuilddir: 'https://oss.eanic.cn/001_code_cocos_res_20260616/Build',
python_pyodide_cdn_dir: 'https://oss.eanic.cn/001_code_python_res_20241213/pyodide/',
// 可以根据需要添加其他配置
disabledev: false,
usecdn: true,
lvlock: false,
lvlock_normal_learn: !(typeof localStorage !== 'undefined' &&
(localStorage.getItem('player_id') === '37' || localStorage.getItem('player_id') === '45' || localStorage.getItem('player_id') === '55')),
lockupdate: false,
mactchlv: false,
learnvideo: true,
gameNumber: 120,
//计算关卡实际id
SSN_COMPETITION_ID: [13],
NOT_ALLOWED_COMPETITION_ID: [72, 62, 64, 65, 69, 61, 63, 67, 70, 74, 73, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84],
BEGINNING_REAL_LVID: 91600,
END_REAL_LVID: 93100,
SIMULATE_COMPETITION_ID: [149], // 用于测试的模拟比赛ID
HIDE_COMPETITION_TIME_ID: [154, 155, 156], // 需要隐藏比赛时间的比赛ID列表
// 计算关卡实际id
getRealLvId(gamelv, gameid, ismatch, gameNumber) {
if (localStorage.getItem('platformMode') === 'competition') {
return parseInt(window.unity_game_number, 10)
} else {
if (!ismatch) {
return ((gamelv - 1) * 30 * gameNumber) + ((gameid - 1) * gameNumber) + this.BEGINNING_REAL_LVID
} else {
//TODO 这里维护一张匹配关卡映射表
if (gamelv === 240896 && gameid === 0) {
return 10000;
}
}
}
},
lastGameStyle: '',
lastGameDefaultSkin: 0,
checkGameStyle(realLvId) {
let gameStyle = 'SILU';
let gameDefaultSkin = 0;
if (realLvId >= this.BEGINNING_REAL_LVID && realLvId <= this.END_REAL_LVID) {
realLvId = realLvId - this.BEGINNING_REAL_LVID;
if (realLvId >= 1 && realLvId <= 300) {
gameStyle = 'SILU';
gameDefaultSkin = 0;
} else if (realLvId >= 301 && realLvId <= 600) {
gameStyle = 'redArmy';
gameDefaultSkin = 2;
} else if (realLvId >= 601 && realLvId <= 900) {
gameStyle = 'numMan';
gameDefaultSkin = 3;
} else if (realLvId >= 901 && realLvId <= 1200) {
gameStyle = 'chinese';
gameDefaultSkin = 1;
} else if (realLvId >= 1201 && realLvId <= 1500) {
gameStyle = 'snow';
gameDefaultSkin = 4;
} else if (realLvId >= 1501 && realLvId <= 1800) {
gameStyle = 'SILU';
gameDefaultSkin = 0;
} else {
gameStyle = 'SILU';
gameDefaultSkin = 0;
}
}
if (gameStyle !== this.lastGameStyle) {
window.unityInstance.SendMessage("GameController", "ChangeUIStyle", gameStyle);
this.lastGameStyle = gameStyle;
}
// 尝试多次发送消息,以确保 Unity 场景和 Player 对象已加载
if (gameDefaultSkin !== this.lastGameDefaultSkin) {
// 尝试多次发送消息,以确保 Unity 场景和 Player 对象已加载
const sendSkinMsg = (delay) => {
setTimeout(() => {
if (window.unityInstance) {
try {
window.unityInstance.SendMessage("Player", "CallChangeSkin", gameDefaultSkin);
console.log("CallChangeSkin sent >>> ", gameDefaultSkin);
} catch (e) {
console.log("Player not ready yet");
}
}
}, delay);
};
sendSkinMsg(2000);
sendSkinMsg(4000);
sendSkinMsg(6000);
this.lastGameDefaultSkin = gameDefaultSkin;
}
}
};
export default CONFIG;

View File

@@ -0,0 +1,283 @@
// config.js
// const CONFIG = {
// DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址
// // DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址
// // DataServerBaseUrl: "https://test.server.001code.com",
// // DataServerBaseUrl: "https://test.server.001code.com",
// // DataServerBaseUrl: "https://test.server.001code.com",
// // DataServerBaseUrl: "https://test.server.001code.com",
// version : "2025010301",
// unitycdndir : 'https://oss-rpwqy.jjwlcdn.com/001_code_unity_res_20250826',
// unitycdnbuilddir : 'https://oss-rpwqy.jjwlcdn.com/001_code_unity_res_20250826/Build',
// python_pyodide_cdn_dir : 'https://oss-rpwqy.jjwlcdn.com/001_code_python_res_20241213/pyodide/',
// // 可以根据需要添加其他配置
// disabledev: false,
// usecdn :true, //资源走CDN
// lvlock :false, //关卡5关解锁,下一关加锁
// lvlock_normal_learn :true, //常规关起锁
// lockupdate :false, //上传按钮
// mactchlv : false, //比赛关卡
// learnvideo : true,
// gameNumber:150,
// SSN_COMPETITION_ID: [13],
// // 计算关卡实际id
// getRealLvId(gamelv,gameid, ismatch, gameNumber){
// if(localStorage.getItem('platformMode') === 'competition'){
// return parseInt(window.unity_game_number, 10)
// }else{
// if (!ismatch){
// return ((gamelv-1)*20*gameNumber)+((gameid-1)*gameNumber)
// }else{
// //TODO 这里维护一张匹配关卡映射表
// if (gamelv === 240896 && gameid === 0) {
// return 10000;
// }
// }
// }
// },
// lastGameStyle: '',
// lastGameDefaultSkin: 0,
// checkGameStyle(realLvId){
// let gameStyle = '';
// let gameDefaultSkin = 0;
// if ((realLvId >= 1 && realLvId <= 400) || (realLvId >= 20001 && realLvId <= 30000)) {
// gameStyle = 'default';
// gameDefaultSkin = 0;
// } else if ((realLvId >= 401 && realLvId <= 800) || (realLvId >= 10001 && realLvId <= 20000)) {
// gameStyle = 'chinese';
// gameDefaultSkin = 1;
// } else if ((realLvId >= 801 && realLvId <= 1200) || (realLvId >= 40001 && realLvId <= 50000)) {
// gameStyle = 'redArmy';
// gameDefaultSkin = 2;
// } else if ((realLvId >= 1201 && realLvId <= 1600) || (realLvId >= 30001 && realLvId <= 40000)) {
// gameStyle = 'numMan';
// gameDefaultSkin = 3;
// }else {
// gameStyle = 'default';
// gameDefaultSkin = 0;
// }
// if (gameStyle !== this.lastGameStyle) {
// window.unityInstance.SendMessage("GameController", "ChangeUIStyle", gameStyle);
// this.lastGameStyle = gameStyle;
// }
// if (gameDefaultSkin !== this.lastGameDefaultSkin) {
// setTimeout(() => {
// window.unityInstance.SendMessage("Player", "CallChangeSkin", gameDefaultSkin);
// console.log("CallChangeSkin >>> ", gameDefaultSkin);
// }, 3000);
// this.lastGameDefaultSkin = gameDefaultSkin;
// }
// }
// };
// const CONFIG = {
// // DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址
// // DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址
// // DataServerBaseUrl: "https://test.server.001code.com",
// DataServerBaseUrl: "https://test.server.001code.com",
// // DataServerBaseUrl: "https://test.server.001code.com",
// // DataServerBaseUrl: "https://test.server.001code.com",
// version : "2025011001",
// unitycdndir : 'https://oss-rpwqy.jjwlcdn.com/001_code_unity_res_20250826',
// unitycdnbuilddir : 'https://oss-rpwqy.jjwlcdn.com/001_code_unity_res_20250826/Build',
// python_pyodide_cdn_dir : 'https://oss-rpwqy.jjwlcdn.com/001_code_python_res_20241213/pyodide/',
// // 可以根据需要添加其他配置
// // disabledev: false,
// disabledev: false,
// usecdn :true, //资源走CDN
// lvlock :false, //关卡5关解锁,下一关加锁
// lvlock_normal_learn : !(typeof localStorage !== 'undefined' &&
// (localStorage.getItem('player_id') === '32' || localStorage.getItem('player_id') === '1506'|| localStorage.getItem('player_id') === '24'|| localStorage.getItem('player_id') === '1550')), //常规关起锁
// lockupdate :false, //上传按钮
// mactchlv : false, //比赛关卡
// learnvideo : true,
// gameNumber:120,
// // 计算关卡实际id
// SSN_COMPETITION_ID: [21,22,23],
// getRealLvId(gamelv,gameid, ismatch, gameNumber){
// if(localStorage.getItem('platformMode') === 'competition'){
// return parseInt(window.unity_game_number, 10)
// }else{
// if (!ismatch){
// return ((gamelv-1)*20*gameNumber)+((gameid-1)*gameNumber)
// }else{
// //TODO 这里维护一张匹配关卡映射表
// if (gamelv === 240896 && gameid === 0) {
// return 10000;
// }
// }
// }
// },
// lastGameStyle: '',
// lastGameDefaultSkin: 0,
// checkGameStyle(realLvId){
// let gameStyle = '';
// let gameDefaultSkin = 0;
// if ((realLvId >= 1 && realLvId <= 400) || (realLvId >= 20001 && realLvId <= 30000)) {
// gameStyle = 'default';
// gameDefaultSkin = 0;
// } else if ((realLvId >= 401 && realLvId <= 800) || (realLvId >= 10001 && realLvId <= 20000)) {
// gameStyle = 'chinese';
// gameDefaultSkin = 1;
// } else if ((realLvId >= 801 && realLvId <= 1200) || (realLvId >= 40001 && realLvId <= 50000)) {
// gameStyle = 'redArmy';
// gameDefaultSkin = 2;
// } else if ((realLvId >= 1201 && realLvId <= 1600) || (realLvId >= 30001 && realLvId <= 40000)) {
// gameStyle = 'numMan';
// gameDefaultSkin = 3;
// }else {
// gameStyle = 'default';
// gameDefaultSkin = 0;
// }
// if (gameStyle !== this.lastGameStyle) {
// window.unityInstance.SendMessage("GameController", "ChangeUIStyle", gameStyle);
// this.lastGameStyle = gameStyle;
// }
// if (gameDefaultSkin !== this.lastGameDefaultSkin) {
// setTimeout(() => {
// window.unityInstance.SendMessage("Player", "CallChangeSkin", gameDefaultSkin);
// console.log("CallChangeSkin >>> ", gameDefaultSkin);
// }, 3000);
// this.lastGameDefaultSkin = gameDefaultSkin;
// }
// }
// };
const CONFIG = {
// DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址
// DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址
// DataServerBaseUrl: "https://test.server.001code.com",
DataServerBaseUrl: "https://test.server.001code.com",
// DataServerBaseUrl: "https://test.server.001code.com",
// DataServerBaseUrl: "https://test.server.001code.com",
version: "20260717",
/** OSS 真实地址(生产环境浏览器直连) */
unityCdnRemote: 'https://oss.eanic.cn/001_code_cocos_res_20260617',
/** 方案 Bnginx / webpack 同源代理前缀(方案 A 直连 OSS 请保持 false */
unityCdnDevProxy: '/cdn-unity',
/** 本地 npm start 也走代理(仅 unityCdnUseSiteProxy 或此项为 true 时生效) */
unityCdnUseDevProxy: false,
/** 生产 nginx 反向代理 OSS 同路径时设为 true方案 B */
unityCdnUseSiteProxy: false,
unitycdndir: 'https://oss.eanic.cn/001_code_cocos_res_20260717',
unitycdnbuilddir: 'https://oss.eanic.cn/001_code_cocos_res_20260717/Build',
python_pyodide_cdn_dir: 'https://oss.eanic.cn/001_code_python_res_20241213/pyodide/',
// 可以根据需要添加其他配置
disabledev: false,
usecdn: true,
lvlock: false,
lvlock_normal_learn: !(typeof localStorage !== 'undefined' &&
(localStorage.getItem('player_id') === '37' || localStorage.getItem('player_id') === '45' || localStorage.getItem('player_id') === '55')),
lockupdate: false,
mactchlv: false,
learnvideo: true,
gameNumber: 120,
//计算关卡实际id
SSN_COMPETITION_ID: [13],
NOT_ALLOWED_COMPETITION_ID: [72, 62, 64, 65, 69, 61, 63, 67, 70, 74, 73, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84],
BEGINNING_REAL_LVID: 91600,
END_REAL_LVID: 93100,
SIMULATE_COMPETITION_ID: [149], // 用于测试的模拟比赛ID
HIDE_COMPETITION_TIME_ID: [154, 155, 156], // 需要隐藏比赛时间的比赛ID列表
// 计算关卡实际id
getRealLvId(gamelv, gameid, ismatch, gameNumber) {
if (localStorage.getItem('platformMode') === 'competition') {
return parseInt(window.unity_game_number, 10)
} else {
if (!ismatch) {
return ((gamelv - 1) * 30 * gameNumber) + ((gameid - 1) * gameNumber) + this.BEGINNING_REAL_LVID
} else {
//TODO 这里维护一张匹配关卡映射表
if (gamelv === 240896 && gameid === 0) {
return 10000;
}
}
}
},
lastGameStyle: '',
lastGameDefaultSkin: 0,
checkGameStyle(realLvId) {
let gameStyle = 'SILU';
let gameDefaultSkin = 0;
if (realLvId >= this.BEGINNING_REAL_LVID && realLvId <= this.END_REAL_LVID) {
realLvId = realLvId - this.BEGINNING_REAL_LVID;
if (realLvId >= 1 && realLvId <= 300) {
gameStyle = 'SILU';
gameDefaultSkin = 0;
} else if (realLvId >= 301 && realLvId <= 600) {
gameStyle = 'redArmy';
gameDefaultSkin = 2;
} else if (realLvId >= 601 && realLvId <= 900) {
gameStyle = 'numMan';
gameDefaultSkin = 3;
} else if (realLvId >= 901 && realLvId <= 1200) {
gameStyle = 'chinese';
gameDefaultSkin = 1;
} else if (realLvId >= 1201 && realLvId <= 1500) {
gameStyle = 'snow';
gameDefaultSkin = 4;
} else if (realLvId >= 1501 && realLvId <= 1800) {
gameStyle = 'SILU';
gameDefaultSkin = 0;
} else {
gameStyle = 'SILU';
gameDefaultSkin = 0;
}
}
if (gameStyle !== this.lastGameStyle) {
window.unityInstance.SendMessage("GameController", "ChangeUIStyle", gameStyle);
this.lastGameStyle = gameStyle;
}
// 尝试多次发送消息,以确保 Unity 场景和 Player 对象已加载
if (gameDefaultSkin !== this.lastGameDefaultSkin) {
// 尝试多次发送消息,以确保 Unity 场景和 Player 对象已加载
const sendSkinMsg = (delay) => {
setTimeout(() => {
if (window.unityInstance) {
try {
window.unityInstance.SendMessage("Player", "CallChangeSkin", gameDefaultSkin);
console.log("CallChangeSkin sent >>> ", gameDefaultSkin);
} catch (e) {
console.log("Player not ready yet");
}
}
}, delay);
};
sendSkinMsg(2000);
sendSkinMsg(4000);
sendSkinMsg(6000);
this.lastGameDefaultSkin = gameDefaultSkin;
}
}
};
export default CONFIG;

View File

@@ -0,0 +1,283 @@
// config.js
// const CONFIG = {
// DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址
// // DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址
// // DataServerBaseUrl: "https://test.server.001code.com",
// // DataServerBaseUrl: "https://test.server.001code.com",
// // DataServerBaseUrl: "https://test.server.001code.com",
// // DataServerBaseUrl: "https://test.server.001code.com",
// version : "2025010301",
// unitycdndir : 'https://oss-rpwqy.jjwlcdn.com/001_code_unity_res_20250826',
// unitycdnbuilddir : 'https://oss-rpwqy.jjwlcdn.com/001_code_unity_res_20250826/Build',
// python_pyodide_cdn_dir : 'https://oss-rpwqy.jjwlcdn.com/001_code_python_res_20241213/pyodide/',
// // 可以根据需要添加其他配置
// disabledev: false,
// usecdn :true, //资源走CDN
// lvlock :false, //关卡5关解锁,下一关加锁
// lvlock_normal_learn :true, //常规关起锁
// lockupdate :false, //上传按钮
// mactchlv : false, //比赛关卡
// learnvideo : true,
// gameNumber:150,
// SSN_COMPETITION_ID: [13],
// // 计算关卡实际id
// getRealLvId(gamelv,gameid, ismatch, gameNumber){
// if(localStorage.getItem('platformMode') === 'competition'){
// return parseInt(window.unity_game_number, 10)
// }else{
// if (!ismatch){
// return ((gamelv-1)*20*gameNumber)+((gameid-1)*gameNumber)
// }else{
// //TODO 这里维护一张匹配关卡映射表
// if (gamelv === 240896 && gameid === 0) {
// return 10000;
// }
// }
// }
// },
// lastGameStyle: '',
// lastGameDefaultSkin: 0,
// checkGameStyle(realLvId){
// let gameStyle = '';
// let gameDefaultSkin = 0;
// if ((realLvId >= 1 && realLvId <= 400) || (realLvId >= 20001 && realLvId <= 30000)) {
// gameStyle = 'default';
// gameDefaultSkin = 0;
// } else if ((realLvId >= 401 && realLvId <= 800) || (realLvId >= 10001 && realLvId <= 20000)) {
// gameStyle = 'chinese';
// gameDefaultSkin = 1;
// } else if ((realLvId >= 801 && realLvId <= 1200) || (realLvId >= 40001 && realLvId <= 50000)) {
// gameStyle = 'redArmy';
// gameDefaultSkin = 2;
// } else if ((realLvId >= 1201 && realLvId <= 1600) || (realLvId >= 30001 && realLvId <= 40000)) {
// gameStyle = 'numMan';
// gameDefaultSkin = 3;
// }else {
// gameStyle = 'default';
// gameDefaultSkin = 0;
// }
// if (gameStyle !== this.lastGameStyle) {
// window.unityInstance.SendMessage("GameController", "ChangeUIStyle", gameStyle);
// this.lastGameStyle = gameStyle;
// }
// if (gameDefaultSkin !== this.lastGameDefaultSkin) {
// setTimeout(() => {
// window.unityInstance.SendMessage("Player", "CallChangeSkin", gameDefaultSkin);
// console.log("CallChangeSkin >>> ", gameDefaultSkin);
// }, 3000);
// this.lastGameDefaultSkin = gameDefaultSkin;
// }
// }
// };
// const CONFIG = {
// // DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址
// // DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址
// // DataServerBaseUrl: "https://test.server.001code.com",
// DataServerBaseUrl: "https://test.server.001code.com",
// // DataServerBaseUrl: "https://test.server.001code.com",
// // DataServerBaseUrl: "https://test.server.001code.com",
// version : "2025011001",
// unitycdndir : 'https://oss-rpwqy.jjwlcdn.com/001_code_unity_res_20250826',
// unitycdnbuilddir : 'https://oss-rpwqy.jjwlcdn.com/001_code_unity_res_20250826/Build',
// python_pyodide_cdn_dir : 'https://oss-rpwqy.jjwlcdn.com/001_code_python_res_20241213/pyodide/',
// // 可以根据需要添加其他配置
// // disabledev: false,
// disabledev: false,
// usecdn :true, //资源走CDN
// lvlock :false, //关卡5关解锁,下一关加锁
// lvlock_normal_learn : !(typeof localStorage !== 'undefined' &&
// (localStorage.getItem('player_id') === '32' || localStorage.getItem('player_id') === '1506'|| localStorage.getItem('player_id') === '24'|| localStorage.getItem('player_id') === '1550')), //常规关起锁
// lockupdate :false, //上传按钮
// mactchlv : false, //比赛关卡
// learnvideo : true,
// gameNumber:120,
// // 计算关卡实际id
// SSN_COMPETITION_ID: [21,22,23],
// getRealLvId(gamelv,gameid, ismatch, gameNumber){
// if(localStorage.getItem('platformMode') === 'competition'){
// return parseInt(window.unity_game_number, 10)
// }else{
// if (!ismatch){
// return ((gamelv-1)*20*gameNumber)+((gameid-1)*gameNumber)
// }else{
// //TODO 这里维护一张匹配关卡映射表
// if (gamelv === 240896 && gameid === 0) {
// return 10000;
// }
// }
// }
// },
// lastGameStyle: '',
// lastGameDefaultSkin: 0,
// checkGameStyle(realLvId){
// let gameStyle = '';
// let gameDefaultSkin = 0;
// if ((realLvId >= 1 && realLvId <= 400) || (realLvId >= 20001 && realLvId <= 30000)) {
// gameStyle = 'default';
// gameDefaultSkin = 0;
// } else if ((realLvId >= 401 && realLvId <= 800) || (realLvId >= 10001 && realLvId <= 20000)) {
// gameStyle = 'chinese';
// gameDefaultSkin = 1;
// } else if ((realLvId >= 801 && realLvId <= 1200) || (realLvId >= 40001 && realLvId <= 50000)) {
// gameStyle = 'redArmy';
// gameDefaultSkin = 2;
// } else if ((realLvId >= 1201 && realLvId <= 1600) || (realLvId >= 30001 && realLvId <= 40000)) {
// gameStyle = 'numMan';
// gameDefaultSkin = 3;
// }else {
// gameStyle = 'default';
// gameDefaultSkin = 0;
// }
// if (gameStyle !== this.lastGameStyle) {
// window.unityInstance.SendMessage("GameController", "ChangeUIStyle", gameStyle);
// this.lastGameStyle = gameStyle;
// }
// if (gameDefaultSkin !== this.lastGameDefaultSkin) {
// setTimeout(() => {
// window.unityInstance.SendMessage("Player", "CallChangeSkin", gameDefaultSkin);
// console.log("CallChangeSkin >>> ", gameDefaultSkin);
// }, 3000);
// this.lastGameDefaultSkin = gameDefaultSkin;
// }
// }
// };
const CONFIG = {
// DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址
// DataServerBaseUrl: "https://test.server.001code.com", // 在这里定义服务器地址
// DataServerBaseUrl: "https://test.server.001code.com",
DataServerBaseUrl: "https://test.server.001code.com",
// DataServerBaseUrl: "https://test.server.001code.com",
// DataServerBaseUrl: "https://test.server.001code.com",
version: "20260520",
/** OSS 真实地址(生产环境浏览器直连) */
unityCdnRemote: 'https://oss.eanic.cn/001_code_cocos_res_20260617',
/** 方案 Bnginx / webpack 同源代理前缀(方案 A 直连 OSS 请保持 false */
unityCdnDevProxy: '/cdn-unity',
/** 本地 npm start 也走代理(仅 unityCdnUseSiteProxy 或此项为 true 时生效) */
unityCdnUseDevProxy: false,
/** 生产 nginx 反向代理 OSS 同路径时设为 true方案 B */
unityCdnUseSiteProxy: false,
unitycdndir: 'https://oss.eanic.cn/001_code_cocos_res_20260617',
unitycdnbuilddir: 'https://oss.eanic.cn/001_code_cocos_res_20260617/Build',
python_pyodide_cdn_dir: 'https://oss.eanic.cn/001_code_python_res_20241213/pyodide/',
// 可以根据需要添加其他配置
disabledev: false,
usecdn: true,
lvlock: false,
lvlock_normal_learn: !(typeof localStorage !== 'undefined' &&
(localStorage.getItem('player_id') === '37' || localStorage.getItem('player_id') === '45' || localStorage.getItem('player_id') === '55')),
lockupdate: false,
mactchlv: false,
learnvideo: true,
gameNumber: 120,
//计算关卡实际id
SSN_COMPETITION_ID: [13],
NOT_ALLOWED_COMPETITION_ID: [72, 62, 64, 65, 69, 61, 63, 67, 70, 74, 73, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84],
BEGINNING_REAL_LVID: 91600,
END_REAL_LVID: 93100,
SIMULATE_COMPETITION_ID: [149], // 用于测试的模拟比赛ID
HIDE_COMPETITION_TIME_ID: [154, 155, 156], // 需要隐藏比赛时间的比赛ID列表
// 计算关卡实际id
getRealLvId(gamelv, gameid, ismatch, gameNumber) {
if (localStorage.getItem('platformMode') === 'competition') {
return parseInt(window.unity_game_number, 10)
} else {
if (!ismatch) {
return ((gamelv - 1) * 30 * gameNumber) + ((gameid - 1) * gameNumber) + this.BEGINNING_REAL_LVID
} else {
//TODO 这里维护一张匹配关卡映射表
if (gamelv === 240896 && gameid === 0) {
return 10000;
}
}
}
},
lastGameStyle: '',
lastGameDefaultSkin: 0,
checkGameStyle(realLvId) {
let gameStyle = 'SILU';
let gameDefaultSkin = 0;
if (realLvId >= this.BEGINNING_REAL_LVID && realLvId <= this.END_REAL_LVID) {
realLvId = realLvId - this.BEGINNING_REAL_LVID;
if (realLvId >= 1 && realLvId <= 300) {
gameStyle = 'SILU';
gameDefaultSkin = 0;
} else if (realLvId >= 301 && realLvId <= 600) {
gameStyle = 'redArmy';
gameDefaultSkin = 2;
} else if (realLvId >= 601 && realLvId <= 900) {
gameStyle = 'numMan';
gameDefaultSkin = 3;
} else if (realLvId >= 901 && realLvId <= 1200) {
gameStyle = 'chinese';
gameDefaultSkin = 1;
} else if (realLvId >= 1201 && realLvId <= 1500) {
gameStyle = 'snow';
gameDefaultSkin = 4;
} else if (realLvId >= 1501 && realLvId <= 1800) {
gameStyle = 'SILU';
gameDefaultSkin = 0;
} else {
gameStyle = 'SILU';
gameDefaultSkin = 0;
}
}
if (gameStyle !== this.lastGameStyle) {
window.unityInstance.SendMessage("GameController", "ChangeUIStyle", gameStyle);
this.lastGameStyle = gameStyle;
}
// 尝试多次发送消息,以确保 Unity 场景和 Player 对象已加载
if (gameDefaultSkin !== this.lastGameDefaultSkin) {
// 尝试多次发送消息,以确保 Unity 场景和 Player 对象已加载
const sendSkinMsg = (delay) => {
setTimeout(() => {
if (window.unityInstance) {
try {
window.unityInstance.SendMessage("Player", "CallChangeSkin", gameDefaultSkin);
console.log("CallChangeSkin sent >>> ", gameDefaultSkin);
} catch (e) {
console.log("Player not ready yet");
}
}
}, delay);
};
sendSkinMsg(2000);
sendSkinMsg(4000);
sendSkinMsg(6000);
this.lastGameDefaultSkin = gameDefaultSkin;
}
}
};
export default CONFIG;

View File

@@ -1523,10 +1523,15 @@
function resolveLevelsDbBase(config) {
var sa = config && config.streamingAssetsUrl;
var base;
if (sa && /^https?:\/\//i.test(sa)) {
return String(sa).replace(/\/StreamingAssets\/?$/i, '');
base = String(sa).replace(/\/StreamingAssets\/?$/i, '');
} else {
base = packageRoot || getPackageRoot();
}
return packageRoot || getPackageRoot();
// new URL(rel, base) 要求 base 以 / 结尾,否则最后一段会被当成文件名
if (base && !/\/$/.test(base)) base += '/';
return base;
}
function resolveLevelsDatabaseUrl(config) {
@@ -1536,7 +1541,8 @@
function resolveLevelsDbIndexUrl(config) {
if (global.__tfrhLevelsDbIndexUrl) return global.__tfrhLevelsDbIndexUrl;
return joinUrl(resolveLevelsDbBase(config), 'levels-db-index.json');
// 与分片同树StreamingAssets/aa/levels-db-index.jsonCDN streamingBase 恒带尾 /
return joinUrl(resolveStreamingBase(config), 'aa/levels-db-index.json');
}
function fetchLevelsDatabaseJson(url) {
@@ -1558,18 +1564,32 @@
function prefetchLevelDbIndex(config) {
var indexUrl = resolveLevelsDbIndexUrl(config);
var rootIndexUrl = joinUrl(resolveLevelsDbBase(config), 'levels-db-index.json');
var legacyUrl = resolveLevelsDatabaseUrl(config);
global.__tfrhLevelsDbIndexUrl = indexUrl;
global.__tfrhLevelsDatabaseUrl = legacyUrl;
if (global.__tfrhLevelsDbIndex) return Promise.resolve();
return fetchLevelsDatabaseJson(indexUrl).then(function (json) {
function acceptIndex(json, usedUrl) {
if (json && json.mode === 'sharded') {
global.__tfrhLevelsDbIndex = json;
global.__tfrhLevelsDbIndexUrl = usedUrl;
return;
}
throw new Error('非分片索引');
}).catch(function (e) {
console.warn('[mstest5] 关卡库索引预取失败,启动时将由 LevelDatabase 回退', indexUrl, e);
}
return fetchLevelsDatabaseJson(indexUrl).then(function (json) {
acceptIndex(json, indexUrl);
}).catch(function (e1) {
// 旧 CDN 包仅有包根 levels-db-index.json
if (rootIndexUrl === indexUrl) {
console.warn('[mstest5] 关卡库索引预取失败,启动时将由 LevelDatabase 回退', indexUrl, e1);
return;
}
return fetchLevelsDatabaseJson(rootIndexUrl).then(function (json) {
acceptIndex(json, rootIndexUrl);
}).catch(function (e2) {
console.warn('[mstest5] 关卡库索引预取失败,启动时将由 LevelDatabase 回退', indexUrl, e1, rootIndexUrl, e2);
});
});
}

Some files were not shown because too many files have changed in this diff Show More