Commit 2f23328a authored by liujiangnan's avatar liujiangnan

feat: 切换模式

parent 3086cff9
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -769,7 +769,8 @@ export default class NewClass extends middleLayerBase {
}
this.loadBundle(sceneName, version, bondleUrl, () => {
cc.find('middleLayer/ram').active = (bundleName == 'NJ_YouLeChang' && this.type == 'aixuebao');
cc.find('middleLayer/change').active = (bundleName == 'NJ_YouLeChang');
cc.find('middleLayer/cross').active = (bundleName == 'NJ_YouLeChang'&&this.gameModel=='cross');
cc.find('middleLayer/free').active = (bundleName == 'NJ_YouLeChang'&&this.gameModel=='free');
callback&&callback();
});
});
......@@ -923,7 +924,8 @@ export default class NewClass extends middleLayerBase {
cc.find('middleLayer/BtnLeft').active = false;
cc.find('middleLayer/ExitBtn').active = false;
cc.find('middleLayer/ram').active = false;
cc.find('middleLayer/change').active = false;
cc.find('middleLayer/cross').active = false;
cc.find('middleLayer/free').active = false;
if (this.type == "aixuebao") {
await this.asyncCallNetworkApiGet(`/api/aixuebao/v1/engine/active`, {
......@@ -1346,11 +1348,22 @@ export default class NewClass extends middleLayerBase {
}, ()=>{});
});
buttonOnClick(cc.find('middleLayer/change'), () => {
this.showConfirm(`确定要切换为${this.gameModel==='cross'?'自由':'闯关'}模式吗?`, ()=>{
this.gameModel = this.gameModel==='cross'?'free':'cross';
cc.sys.localStorage.setItem('gameModel', this.gameModel);
this.showTips(`已切换为${this.gameModel==='cross'?'闯关':'自由'}模式`);
buttonOnClick(cc.find('middleLayer/cross'), () => {
this.showConfirm(`确定要切换为自由模式吗?`, ()=>{
this.gameModel = "free";
cc.sys.localStorage.setItem('gameModel', "free");
cc.find('middleLayer/cross').active = false;
cc.find('middleLayer/free').active = true;
this.showTips(`已切换为自由模式`);
}, ()=>{});
});
buttonOnClick(cc.find('middleLayer/free'), () => {
this.showConfirm(`确定要切换为闯关模式吗?`, ()=>{
this.gameModel = "cross";
cc.sys.localStorage.setItem('gameModel', "cross");
cc.find('middleLayer/cross').active = true;
cc.find('middleLayer/free').active = false;
this.showTips(`已切换为闯关模式`);
}, ()=>{});
});
......
......@@ -303,7 +303,8 @@ export abstract class middleLayerBase extends cc.Component {
this.showWaitingLetters();
cc.find('middleLayer/ram').active = false;
cc.find('middleLayer/change').active = false;
cc.find('middleLayer/cross').active = false;
cc.find('middleLayer/free').active = false;
let api = `/api/courseware/v2/${courseId}/list`;
if (linkFlag === true) {
......
{
"ver": "2.3.5",
"uuid": "e088234f-184f-48ba-b1ba-2bb98eb0fa91",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 150,
"height": 150,
"platformSettings": {},
"subMetas": {
"cross": {
"ver": "1.0.4",
"uuid": "94a359f2-4b2a-4188-a716-f8352aa83f40",
"rawTextureUuid": "e088234f-184f-48ba-b1ba-2bb98eb0fa91",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 150,
"height": 150,
"rawWidth": 150,
"rawHeight": 150,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "f8945283-eaa4-4b57-b4e7-62ca6526dff6",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 150,
"height": 150,
"platformSettings": {},
"subMetas": {
"free": {
"ver": "1.0.4",
"uuid": "a3d095bc-b70e-48f2-8d51-afdb5b142bce",
"rawTextureUuid": "f8945283-eaa4-4b57-b4e7-62ca6526dff6",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 150,
"height": 150,
"rawWidth": 150,
"rawHeight": 150,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment