// Initializes the UI List based on the rewards size private void InitializeDailyRewardsUI() { title.text = LocalizationManager.instance.StringForKey("DailyReward_Title"); buttonClaim_Text.text = LocalizationManager.instance.StringForKey("DailyReward_ButtonClaimText"); buttonClose_Text.text = LocalizationManager.instance.StringForKey("DailyReward_ButtonCloseText"); buttonCloseReward_Text.text = LocalizationManager.instance.StringForKey("DailyReward_ButtonCloseText"); for (int i = 0; i < dailyRewards.rewards.Count; i++) { int day = i + 1; var reward = dailyRewards.GetReward(day); GameObject dailyRewardGo = GameObject.Instantiate(dailyRewardPrefab) as GameObject; DailyRewardUI dailyRewardUI = dailyRewardGo.GetComponent <DailyRewardUI>(); dailyRewardUI.transform.SetParent(dailyRewardsGroup.transform); dailyRewardGo.transform.localScale = Vector2.one; dailyRewardUI.day = day; dailyRewardUI.reward = reward; dailyRewardUI.Initialize(); dailyRewardsUI.Add(dailyRewardUI); } }
// Initializes the UI List based on the rewards size private void InitializeDailyRewardsUI() { for (int i = 0; i < dailyRewards.rewards.Count; i++) { int day = i + 1; var reward = dailyRewards.GetReward(day); GameObject dailyRewardGo = GameObject.Instantiate(dailyRewardPrefab) as GameObject; DailyRewardUI dailyRewardUI = dailyRewardGo.GetComponent <DailyRewardUI>(); dailyRewardUI.transform.SetParent(dailyRewardsGroup.transform); dailyRewardGo.transform.localScale = Vector2.one; dailyRewardUI.day = day; dailyRewardUI.reward = reward; dailyRewardUI.Initialize(); dailyRewardsUI.Add(dailyRewardUI); } }