// 보상 셋팅 public void SetReward(DataPackage package, DataPackageShop shop) { if (package == null || shop == null) { return; } _itemList.ClearItems(); int start = (int)EPackageRewardType.Main; int end = (int)EPackageRewardType.Bonus; for (int i = start; i <= end; i++) { List <RewardInfo> infos = new List <RewardInfo>(); EPackageRewardType rewardType = (EPackageRewardType)i; infos.AddRange(GetPackageInfos(package.GetID(), rewardType, shop)); if (infos.Count > 0) { GameObject slot = _itemList.AddItem(rewardType.ToString()); UIBaseRewardGroupItem item = slot.GetComponent <UIBaseRewardGroupItem>(); if (item != null) { item.SetRewardGroupItem(infos, rewardType, shop); } } } _itemList.OnRepositionDelay(); }
// 보상 아이템 셋팅 public void SetRewardItem(DataGuildReward data) { // null체크 if (data == null) { Debug.Log("Data is Null"); return; } _itemList.ClearItems(); _labelTitle.text = data.GetName(); List <RewardInfo> rewardList = GetAttendRewardList(data); for (int i = 0; i < rewardList.Count; i++) { GameObject slot = _itemList.AddItem(i.ToString()); RewardItem item = UIHelper.FindChildComponentByName <RewardItem>(slot, "ThumbnailReward"); item.SetReward(rewardList[i], true, true); } _itemList.OnRepositionDelay(); }