LF
This commit is contained in:
@@ -843,7 +843,7 @@ class MenuBar extends React.Component {
|
|||||||
let realLvId_tmp = '';
|
let realLvId_tmp = '';
|
||||||
// 发送消息给 Unity 实例,切换关卡
|
// 发送消息给 Unity 实例,切换关卡
|
||||||
if (localStorage.getItem('platformMode') === 'normal') {
|
if (localStorage.getItem('platformMode') === 'normal') {
|
||||||
realLvId_tmp = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv;
|
realLvId_tmp = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv;
|
||||||
} else {
|
} else {
|
||||||
realLvId_tmp = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber);
|
realLvId_tmp = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ const CurrentLevelChoose = ({ onCancel }) => {
|
|||||||
console.warn('window.loadCppProject 未定义或不是函数');
|
console.warn('window.loadCppProject 未定义或不是函数');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const realLvId_tmp = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber);
|
const realLvId_tmp = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode);
|
||||||
const realLvId = realLvId_tmp + cellIndex
|
const realLvId = realLvId_tmp + cellIndex
|
||||||
window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId);
|
window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId);
|
||||||
CONFIG.checkGameStyle(realLvId);
|
CONFIG.checkGameStyle(realLvId);
|
||||||
|
|||||||
@@ -592,7 +592,7 @@ const UnityComponent = function (props) {
|
|||||||
//计算真实关卡位置
|
//计算真实关卡位置
|
||||||
let realLvId = 0;
|
let realLvId = 0;
|
||||||
if (localStorage.getItem('platformMode') === 'normal') {
|
if (localStorage.getItem('platformMode') === 'normal') {
|
||||||
realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv
|
realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv
|
||||||
} else {
|
} else {
|
||||||
realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber)
|
realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber)
|
||||||
}
|
}
|
||||||
@@ -702,7 +702,7 @@ const UnityComponent = function (props) {
|
|||||||
window.iscreate = 1;
|
window.iscreate = 1;
|
||||||
let realLvId = 0;
|
let realLvId = 0;
|
||||||
if (localStorage.getItem('platformMode') === 'normal') {
|
if (localStorage.getItem('platformMode') === 'normal') {
|
||||||
realLvId = CONFIG.getRealLvId(gamelvdataJson.gamelv, gamelvdataJson.gameid, gamelvdataJson.ismatch, gamelvdataJson.gameNumber) + window.gamelvdata.currentlv
|
realLvId = CONFIG.getRealLvId(gamelvdataJson.gamelv, gamelvdataJson.gameid, gamelvdataJson.ismatch, gamelvdataJson.gameNumber, gamelvdataJson.gamemode) + window.gamelvdata.currentlv
|
||||||
} else {
|
} else {
|
||||||
realLvId = CONFIG.getRealLvId(gamelvdataJson.gamelv, gamelvdataJson.gameid, gamelvdataJson.ismatch, gamelvdataJson.gameNumber)
|
realLvId = CONFIG.getRealLvId(gamelvdataJson.gamelv, gamelvdataJson.gameid, gamelvdataJson.ismatch, gamelvdataJson.gameNumber)
|
||||||
}
|
}
|
||||||
@@ -719,7 +719,8 @@ const UnityComponent = function (props) {
|
|||||||
// 延迟 500 毫秒后切换关卡,只执行一次
|
// 延迟 500 毫秒后切换关卡,只执行一次
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (localStorage.getItem('platformMode') === 'normal') {
|
if (localStorage.getItem('platformMode') === 'normal') {
|
||||||
const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv
|
|
||||||
|
const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv
|
||||||
window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId);
|
window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId);
|
||||||
} else {
|
} else {
|
||||||
const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber)
|
const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber)
|
||||||
@@ -778,7 +779,8 @@ const UnityComponent = function (props) {
|
|||||||
|
|
||||||
const savedProject = window.cppCode;
|
const savedProject = window.cppCode;
|
||||||
setIsLockNextButton(true);
|
setIsLockNextButton(true);
|
||||||
const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv
|
|
||||||
|
const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv
|
||||||
const trialCount = localStorage.getItem('trial_count');
|
const trialCount = localStorage.getItem('trial_count');
|
||||||
|
|
||||||
if (localStorage.getItem('permission') === "0" && (realLvId - CONFIG.BEGINNING_REAL_LVID) >= trialCount && currentlv > 9) {
|
if (localStorage.getItem('permission') === "0" && (realLvId - CONFIG.BEGINNING_REAL_LVID) >= trialCount && currentlv > 9) {
|
||||||
@@ -1161,8 +1163,9 @@ const UnityComponent = function (props) {
|
|||||||
} else {
|
} else {
|
||||||
setIsNextButtonComplete(false);
|
setIsNextButtonComplete(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
window.gamelvdata.currentlv = window.gamelvdata.currentlv + 1
|
window.gamelvdata.currentlv = window.gamelvdata.currentlv + 1
|
||||||
const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv
|
const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv
|
||||||
|
|
||||||
window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId);
|
window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId);
|
||||||
CONFIG.checkGameStyle(realLvId);
|
CONFIG.checkGameStyle(realLvId);
|
||||||
@@ -1219,7 +1222,8 @@ const UnityComponent = function (props) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleRetry = () => {
|
const handleRetry = () => {
|
||||||
const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv
|
|
||||||
|
const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv
|
||||||
window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId);
|
window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId);
|
||||||
console.log("Retrying the current level...");
|
console.log("Retrying the current level...");
|
||||||
};
|
};
|
||||||
@@ -1283,7 +1287,7 @@ const UnityComponent = function (props) {
|
|||||||
//计算真实关卡位置
|
//计算真实关卡位置
|
||||||
let realLvId = 0;
|
let realLvId = 0;
|
||||||
if (localStorage.getItem('platformMode') === 'normal') {
|
if (localStorage.getItem('platformMode') === 'normal') {
|
||||||
realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv
|
realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv
|
||||||
} else {
|
} else {
|
||||||
realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber)
|
realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ const CurrentLevelChoose = ({ onCancel }) => {
|
|||||||
// 清除所有代码
|
// 清除所有代码
|
||||||
window.loadPythonProject(`` + `\n`.repeat(50));
|
window.loadPythonProject(`` + `\n`.repeat(50));
|
||||||
}
|
}
|
||||||
const realLvId_tmp = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber);
|
const realLvId_tmp = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode);
|
||||||
const realLvId = realLvId_tmp + cellIndex
|
const realLvId = realLvId_tmp + cellIndex
|
||||||
window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId);
|
window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId);
|
||||||
CONFIG.checkGameStyle(realLvId);
|
CONFIG.checkGameStyle(realLvId);
|
||||||
|
|||||||
@@ -592,7 +592,7 @@ const UnityComponent = function (props) {
|
|||||||
//计算真实关卡位置
|
//计算真实关卡位置
|
||||||
let realLvId = 0;
|
let realLvId = 0;
|
||||||
if (localStorage.getItem('platformMode') === 'normal') {
|
if (localStorage.getItem('platformMode') === 'normal') {
|
||||||
realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv
|
realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv
|
||||||
} else {
|
} else {
|
||||||
realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber)
|
realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber)
|
||||||
}
|
}
|
||||||
@@ -702,7 +702,7 @@ const UnityComponent = function (props) {
|
|||||||
window.iscreate = 1;
|
window.iscreate = 1;
|
||||||
let realLvId = 0;
|
let realLvId = 0;
|
||||||
if (localStorage.getItem('platformMode') === 'normal') {
|
if (localStorage.getItem('platformMode') === 'normal') {
|
||||||
realLvId = CONFIG.getRealLvId(gamelvdataJson.gamelv, gamelvdataJson.gameid, gamelvdataJson.ismatch, gamelvdataJson.gameNumber) + window.gamelvdata.currentlv
|
realLvId = CONFIG.getRealLvId(gamelvdataJson.gamelv, gamelvdataJson.gameid, gamelvdataJson.ismatch, gamelvdataJson.gameNumber, gamelvdataJson.gamemode) + window.gamelvdata.currentlv
|
||||||
} else {
|
} else {
|
||||||
realLvId = CONFIG.getRealLvId(gamelvdataJson.gamelv, gamelvdataJson.gameid, gamelvdataJson.ismatch, gamelvdataJson.gameNumber)
|
realLvId = CONFIG.getRealLvId(gamelvdataJson.gamelv, gamelvdataJson.gameid, gamelvdataJson.ismatch, gamelvdataJson.gameNumber)
|
||||||
}
|
}
|
||||||
@@ -719,7 +719,7 @@ const UnityComponent = function (props) {
|
|||||||
// 延迟 500 毫秒后切换关卡,只执行一次
|
// 延迟 500 毫秒后切换关卡,只执行一次
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (localStorage.getItem('platformMode') === 'normal') {
|
if (localStorage.getItem('platformMode') === 'normal') {
|
||||||
const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv
|
const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv
|
||||||
window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId);
|
window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId);
|
||||||
} else {
|
} else {
|
||||||
const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber)
|
const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber)
|
||||||
@@ -776,7 +776,7 @@ const UnityComponent = function (props) {
|
|||||||
const savedProject = window.pythonCode;
|
const savedProject = window.pythonCode;
|
||||||
setIsLockNextButton(true);
|
setIsLockNextButton(true);
|
||||||
|
|
||||||
const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv
|
const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv
|
||||||
const trialCount = localStorage.getItem('trial_count');
|
const trialCount = localStorage.getItem('trial_count');
|
||||||
|
|
||||||
if (localStorage.getItem('permission') === "0" && (realLvId - CONFIG.BEGINNING_REAL_LVID) >= trialCount && currentlv > 9) {
|
if (localStorage.getItem('permission') === "0" && (realLvId - CONFIG.BEGINNING_REAL_LVID) >= trialCount && currentlv > 9) {
|
||||||
@@ -1156,7 +1156,7 @@ const UnityComponent = function (props) {
|
|||||||
setIsNextButtonComplete(false);
|
setIsNextButtonComplete(false);
|
||||||
}
|
}
|
||||||
window.gamelvdata.currentlv = window.gamelvdata.currentlv + 1
|
window.gamelvdata.currentlv = window.gamelvdata.currentlv + 1
|
||||||
const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv
|
const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv
|
||||||
|
|
||||||
window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId);
|
window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId);
|
||||||
CONFIG.checkGameStyle(realLvId);
|
CONFIG.checkGameStyle(realLvId);
|
||||||
@@ -1208,7 +1208,7 @@ const UnityComponent = function (props) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleRetry = () => {
|
const handleRetry = () => {
|
||||||
const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv
|
const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv
|
||||||
window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId);
|
window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId);
|
||||||
console.log("Retrying the current level...");
|
console.log("Retrying the current level...");
|
||||||
};
|
};
|
||||||
@@ -1272,7 +1272,7 @@ const UnityComponent = function (props) {
|
|||||||
//计算真实关卡位置
|
//计算真实关卡位置
|
||||||
let realLvId = 0;
|
let realLvId = 0;
|
||||||
if (localStorage.getItem('platformMode') === 'normal') {
|
if (localStorage.getItem('platformMode') === 'normal') {
|
||||||
realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv
|
realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv
|
||||||
} else {
|
} else {
|
||||||
realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber)
|
realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ const CurrentLevelChoose = ({ onCancel }) => {
|
|||||||
}
|
}
|
||||||
// window.handleClickNewProjectWithUnity();
|
// window.handleClickNewProjectWithUnity();
|
||||||
}
|
}
|
||||||
const realLvId_tmp = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber);
|
const realLvId_tmp = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode);
|
||||||
const realLvId = realLvId_tmp + cellIndex
|
const realLvId = realLvId_tmp + cellIndex
|
||||||
window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId);
|
window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId);
|
||||||
CONFIG.checkGameStyle(realLvId);
|
CONFIG.checkGameStyle(realLvId);
|
||||||
|
|||||||
@@ -790,7 +790,7 @@ const UnityComponent = function (props) {
|
|||||||
//计算真实关卡位置
|
//计算真实关卡位置
|
||||||
let realLvId = 0;
|
let realLvId = 0;
|
||||||
if (localStorage.getItem('platformMode') === 'normal') {
|
if (localStorage.getItem('platformMode') === 'normal') {
|
||||||
realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv
|
realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv
|
||||||
} else {
|
} else {
|
||||||
realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber)
|
realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber)
|
||||||
}
|
}
|
||||||
@@ -914,7 +914,7 @@ const UnityComponent = function (props) {
|
|||||||
window.iscreate = 1;
|
window.iscreate = 1;
|
||||||
let realLvId = 0;
|
let realLvId = 0;
|
||||||
if (localStorage.getItem('platformMode') === 'normal') {
|
if (localStorage.getItem('platformMode') === 'normal') {
|
||||||
realLvId = CONFIG.getRealLvId(gamelvdataJson.gamelv, gamelvdataJson.gameid, gamelvdataJson.ismatch, gamelvdataJson.gameNumber) + window.gamelvdata.currentlv
|
realLvId = CONFIG.getRealLvId(gamelvdataJson.gamelv, gamelvdataJson.gameid, gamelvdataJson.ismatch, gamelvdataJson.gameNumber, gamelvdataJson.gamemode) + window.gamelvdata.currentlv
|
||||||
} else {
|
} else {
|
||||||
realLvId = CONFIG.getRealLvId(gamelvdataJson.gamelv, gamelvdataJson.gameid, gamelvdataJson.ismatch, gamelvdataJson.gameNumber)
|
realLvId = CONFIG.getRealLvId(gamelvdataJson.gamelv, gamelvdataJson.gameid, gamelvdataJson.ismatch, gamelvdataJson.gameNumber)
|
||||||
}
|
}
|
||||||
@@ -931,7 +931,7 @@ const UnityComponent = function (props) {
|
|||||||
// 延迟 500 毫秒后切换关卡,只执行一次
|
// 延迟 500 毫秒后切换关卡,只执行一次
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (localStorage.getItem('platformMode') === 'normal') {
|
if (localStorage.getItem('platformMode') === 'normal') {
|
||||||
const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv
|
const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv
|
||||||
window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId);
|
window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId);
|
||||||
} else {
|
} else {
|
||||||
const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber)
|
const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber)
|
||||||
@@ -993,7 +993,7 @@ const UnityComponent = function (props) {
|
|||||||
}
|
}
|
||||||
setIsLockNextButton(true);
|
setIsLockNextButton(true);
|
||||||
|
|
||||||
const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv
|
const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv
|
||||||
const trialCount = localStorage.getItem('trial_count');
|
const trialCount = localStorage.getItem('trial_count');
|
||||||
|
|
||||||
if (localStorage.getItem('permission') === "0" && (realLvId - CONFIG.BEGINNING_REAL_LVID) >= trialCount && currentlv > 9) {
|
if (localStorage.getItem('permission') === "0" && (realLvId - CONFIG.BEGINNING_REAL_LVID) >= trialCount && currentlv > 9) {
|
||||||
@@ -1412,7 +1412,7 @@ const UnityComponent = function (props) {
|
|||||||
setIsNextButtonComplete(false);
|
setIsNextButtonComplete(false);
|
||||||
}
|
}
|
||||||
window.gamelvdata.currentlv = window.gamelvdata.currentlv + 1
|
window.gamelvdata.currentlv = window.gamelvdata.currentlv + 1
|
||||||
const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv
|
const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv
|
||||||
console.log(window.gamelvdata.currentlv, window.gamelvdataJson.gameNumber)
|
console.log(window.gamelvdata.currentlv, window.gamelvdataJson.gameNumber)
|
||||||
removeGlobalKeyboardShield();
|
removeGlobalKeyboardShield();
|
||||||
window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId);
|
window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId);
|
||||||
@@ -1470,7 +1470,7 @@ const UnityComponent = function (props) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleRetry = () => {
|
const handleRetry = () => {
|
||||||
const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv
|
const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv
|
||||||
removeGlobalKeyboardShield();
|
removeGlobalKeyboardShield();
|
||||||
window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId);
|
window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId);
|
||||||
console.log("Retrying the current level...realLvId...", realLvId);
|
console.log("Retrying the current level...realLvId...", realLvId);
|
||||||
@@ -1536,7 +1536,7 @@ const UnityComponent = function (props) {
|
|||||||
|
|
||||||
let realLvId = 0;
|
let realLvId = 0;
|
||||||
if (localStorage.getItem('platformMode') === 'normal') {
|
if (localStorage.getItem('platformMode') === 'normal') {
|
||||||
realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv
|
realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv
|
||||||
} else {
|
} else {
|
||||||
realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber)
|
realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -195,16 +195,28 @@ const CONFIG = {
|
|||||||
SSN_COMPETITION_ID: [13],
|
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],
|
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,
|
BEGINNING_REAL_LVID: 91600,
|
||||||
END_REAL_LVID: 93100,
|
END_REAL_LVID: 93400,
|
||||||
SIMULATE_COMPETITION_ID: [149], // 用于测试的模拟比赛ID
|
SIMULATE_COMPETITION_ID: [149], // 用于测试的模拟比赛ID
|
||||||
HIDE_COMPETITION_TIME_ID: [154, 155, 156], // 需要隐藏比赛时间的比赛ID列表
|
HIDE_COMPETITION_TIME_ID: [154, 155, 156], // 需要隐藏比赛时间的比赛ID列表
|
||||||
|
MODE_START_OFFSET: {
|
||||||
|
'1': [0, 0, 0], //Level A
|
||||||
|
'2': [0, 0, 0], //Level B
|
||||||
|
'3': [0, 0, 0], //Level C
|
||||||
|
'4': [0, 0, 0], //Level D
|
||||||
|
'5': [0, 0, 0], //Level E
|
||||||
|
'6': [0, 300, 600], //Level F
|
||||||
|
},
|
||||||
// 计算关卡实际id
|
// 计算关卡实际id
|
||||||
getRealLvId(gamelv, gameid, ismatch, gameNumber) {
|
getRealLvId(gamelv, gameid, ismatch, gameNumber, gamemode) {
|
||||||
if (localStorage.getItem('platformMode') === 'competition') {
|
if (localStorage.getItem('platformMode') === 'competition') {
|
||||||
return parseInt(window.unity_game_number, 10)
|
return parseInt(window.unity_game_number, 10)
|
||||||
} else {
|
} else {
|
||||||
if (!ismatch) {
|
if (!ismatch) {
|
||||||
return ((gamelv - 1) * 30 * gameNumber) + ((gameid - 1) * gameNumber) + this.BEGINNING_REAL_LVID
|
let modeOffset = 0;
|
||||||
|
if (this.MODE_START_OFFSET && this.MODE_START_OFFSET[gamelv]) {
|
||||||
|
modeOffset = this.MODE_START_OFFSET[gamelv][gamemode - 1] || 0;
|
||||||
|
}
|
||||||
|
return (modeOffset + (gamelv - 1) * 30 * gameNumber) + ((gameid - 1) * gameNumber) + this.BEGINNING_REAL_LVID
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//TODO 这里维护一张匹配关卡映射表
|
//TODO 这里维护一张匹配关卡映射表
|
||||||
|
|||||||
Reference in New Issue
Block a user