Skip to content

Commit

Permalink
Merge pull request #3672 from planetarium/bugfix/seasonpass-cell-notr…
Browse files Browse the repository at this point in the history
…efreshed

season pass cell view bugfix
  • Loading branch information
jonny-jeahyunchoi authored Nov 24, 2023
2 parents ab1331e + 588cfa5 commit 89d74d5
Showing 1 changed file with 25 additions and 12 deletions.
37 changes: 25 additions & 12 deletions nekoyume/Assets/_Scripts/UI/Widget/SeasonPass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,22 +94,33 @@ protected override void Awake()

seasonPassManager.SeasonEndDate.Subscribe((endTime) =>
{
for (int i = 0; i < rewardCells.Length; i++)
{
if (i < seasonPassManager.CurrentSeasonPassData.RewardList.Count)
{
rewardCells[i].gameObject.SetActive(true);
rewardCells[i].SetData(seasonPassManager.CurrentSeasonPassData.RewardList[i]);
}
else
{
rewardCells[i].gameObject.SetActive(false);
}
}
RefreshRewardCells(seasonPassManager);
}).AddTo(gameObject);
rewardCellScrollbar.value = 0;
}

private void RefreshRewardCells(SeasonPassServiceManager seasonPassManager)
{
if (seasonPassManager.CurrentSeasonPassData == null)
{
Debug.LogError("[RefreshRewardCells] RefreshFailed");
return;
}

for (int i = 0; i < rewardCells.Length; i++)
{
if (i < seasonPassManager.CurrentSeasonPassData.RewardList.Count)
{
rewardCells[i].gameObject.SetActive(true);
rewardCells[i].SetData(seasonPassManager.CurrentSeasonPassData.RewardList[i]);
}
else
{
rewardCells[i].gameObject.SetActive(false);
}
}
}

public void ShowSeasonPassPremiumPopup()
{
#if UNITY_ANDROID || UNITY_IOS
Expand Down Expand Up @@ -141,6 +152,8 @@ public override void Show(bool ignoreShowAnimation = false)
var seasonPassManager = Game.Game.instance.SeasonPassServiceManager;
seasonPassManager.AvatarStateRefreshAsync().AsUniTask().Forget();

RefreshRewardCells(seasonPassManager);

if(!ignoreShowAnimation)
PageEffect();

Expand Down

0 comments on commit 89d74d5

Please sign in to comment.