# 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
283 lines
12 KiB
JavaScript
283 lines
12 KiB
JavaScript
// 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',
|
||
/** 方案 B:nginx / 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; |