Commit fc02c369 authored by liujiangnan's avatar liujiangnan

feat: 未解锁提示

parent 3d6267a5
...@@ -84,14 +84,12 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -84,14 +84,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
return { id: row.id, locked: locked }; return { id: row.id, locked: locked };
}); });
ballData.forEach((data, idx) => { for (let i=0;i<5;i++) {
if (idx >= 5) { const idx = i;
console.warn('idx >= 5'); const data = ballData[i];
return;
}
const star = cc.find(`Canvas/bg/bg_circle/star_${idx}`); const star = cc.find(`Canvas/bg/bg_circle/star_${idx}`);
const lock = cc.find(`Canvas/bg/bg_circle/star_${idx}/lock`); const lock = cc.find(`Canvas/bg/bg_circle/star_${idx}/lock`);
if (data) {
if (data.locked) { if (data.locked) {
lock.active = true; lock.active = true;
} else { } else {
...@@ -116,9 +114,17 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -116,9 +114,17 @@ export default class SceneComponent extends MyCocosSceneComponent {
middleLayerComponent.setData('nextLevelId', ballData[idx+1]?ballData[idx+1].id: null); middleLayerComponent.setData('nextLevelId', ballData[idx+1]?ballData[idx+1].id: null);
middleLayerComponent.loadOnlineBundle('NJ_MonkyTree'); middleLayerComponent.loadOnlineBundle('NJ_MonkyTree');
} }
} else {
this.showTips("未解锁");
} }
}); });
} else {
lock.active = true;
buttonOnClick(star, async () => {
this.showTips("精彩在路上~ 敬请期待!");
}); });
}
}
} }
......
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