关卡显示逻辑修改

This commit is contained in:
yangjing 2022-02-13 17:50:39 +08:00
parent 28bebb61c5
commit e4e12e0274
1 changed files with 6 additions and 3 deletions

View File

@ -11,8 +11,11 @@ public class LevelPage : PageView
{ {
get get
{ {
int tCount = GameConfig.Instance.LevelSort.Count + 1; int tTotalCount = GameConfig.Instance.LevelSort.Count + 1;//add coming soon
return tCount; int tUnlockedCount = PlayerData.Instance.UnlockedLevel;
int tEnoughCount = (tUnlockedCount / CountPerPage + 1) + (tUnlockedCount % CountPerPage == 0 ? -1 : 0);
return Mathf.Min(tTotalCount, tEnoughCount * CountPerPage);
} }
} }
@ -27,7 +30,7 @@ public class LevelPage : PageView
} }
else else
{ {
if (pIndex < Count - 1) if (pIndex < GameConfig.Instance.LevelSort.Count)
{ {
tCell.SetEmpty(); tCell.SetEmpty();
} }