From e4e12e02745bab343b07631a3a9dc3a9bf106ea4 Mon Sep 17 00:00:00 2001 From: yangjing Date: Sun, 13 Feb 2022 17:50:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E5=8D=A1=E6=98=BE=E7=A4=BA=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/UI/CustomControl/LevelList/LevelPage.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/UI/CustomControl/LevelList/LevelPage.cs b/Assets/Scripts/UI/CustomControl/LevelList/LevelPage.cs index 2883a784..e2e8d66d 100644 --- a/Assets/Scripts/UI/CustomControl/LevelList/LevelPage.cs +++ b/Assets/Scripts/UI/CustomControl/LevelList/LevelPage.cs @@ -11,8 +11,11 @@ public class LevelPage : PageView { get { - int tCount = GameConfig.Instance.LevelSort.Count + 1; - return tCount; + int tTotalCount = GameConfig.Instance.LevelSort.Count + 1;//add coming soon + 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 { - if (pIndex < Count - 1) + if (pIndex < GameConfig.Instance.LevelSort.Count) { tCell.SetEmpty(); }