コード例 #1
0
    // 보상 리스트 가져오기
    List <RewardInfo> GetAttendRewardList(DataGuildReward data)
    {
        List <RewardInfo> rewardList = new List <RewardInfo>();

        for (int i = 0; i < data.GetREWARD_TYPECount(); i++)
        {
            EGoodsType goods = (EGoodsType)data.GetREWARD_TYPE(i);
            if (goods != EGoodsType.None)
            {
                string     rewardValue = data.GetREWARD_VALUE(i);
                RewardInfo reward      = new RewardInfo(goods, rewardValue);
                rewardList.Add(reward);
            }
        }
        return(rewardList);
    }
コード例 #2
0
    // 보상 아이템 셋팅
    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();
    }