Example #1
0
        public static List <GeneralRewardItem> GetRewardItem(int groupID)
        {
            List <GeneralRewardItem> result = new List <GeneralRewardItem>();
            var group = Config.ConfigData.RewardData.rewardGroup.Find(x => x.GroupID == groupID);

            if (group != null)
            {
                for (int i = 0; i < group.itemList.Count; i++)
                {
                    GeneralRewardItem item = new GeneralRewardItem(
                        (GeneralRewardItem.RewardType)group.itemList[i].type,
                        group.itemList[i].ItemID,
                        group.itemList[i].count);
                    result.Add(item);
                }
            }
            return(result);
        }
Example #2
0
 public void SetUpItem(GeneralRewardItem item)
 {
     _item = item;
     if (item.type == GeneralRewardItem.RewardType.Material)
     {
         if (MaterialModule.GetMaterialByMaterialID(item.ItemID) != null)
         {
             var icon = MaterialModule.GetMaterialSprite(item.ItemID);
             _icon.sprite = icon;
             _count.text  = item.count.ToString();
         }
     }
     else if (item.type == GeneralRewardItem.RewardType.Tech_Unlock)
     {
         if (TechnologyModule.GetTechDataByID(item.ItemID) != null)
         {
             var icon = TechnologyModule.GetTechIcon(item.ItemID);
             _icon.sprite = icon;
         }
     }
 }