| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 | 
							- using System.Collections.Generic;
 
- using System.Linq;
 
- using Core.Language;
 
- using Excel2Json;
 
- using Fort23.UTool;
 
- using GameLogic.Bag;
 
- namespace Fort23.Mono
 
- {
 
-     [UIBinding(prefab = "DaoYouLevelWidget")]
 
-     public partial class DaoYouLevelWidget : UIComponent
 
-     {
 
-         private AccountFileInfo.DaoYouData daoYouData;
 
-         public DaoyouLevelupConfig _daoyouLevelupConfig;
 
-         List<DaoYouWidgetItem> _widgetItems = new List<DaoYouWidgetItem>();
 
-         private void Init()
 
-         {
 
-         }
 
-         public override void AddEvent()
 
-         {
 
-         }
 
-         public override void DelEvent()
 
-         {
 
-         }
 
-         public override void AddButtonEvent()
 
-         {
 
-             Btn_Award.onClick.AddListener(() =>
 
-             {
 
-                 if (daoYouData.awardLevels.Contains(_daoyouLevelupConfig.ID) || daoYouData.favorabilityLv < _daoyouLevelupConfig.ID)
 
-                 {
 
-                     return;
 
-                 }
 
-                 List<ItemInfo> items = new List<ItemInfo>();
 
-                 DaoyouModelConfig daoyouModelConfig = ConfigComponent.Instance.Get<DaoyouModelConfig>(daoYouData.id);
 
-                 for (var i = 0; i < _daoyouLevelupConfig.prizeID?.Length; i++)
 
-                 {
 
-                     items.Add(new ItemInfo(_daoyouLevelupConfig.prizeID[i], _daoyouLevelupConfig.prizeNum[i]));
 
-                 }
 
-                 if (daoyouModelConfig.EmotionLvforspecialGift.Contains(_daoyouLevelupConfig.ID))
 
-                 {
 
-                     int index = daoyouModelConfig.EmotionLvforspecialGift.ToList().IndexOf(_daoyouLevelupConfig.ID);
 
-                     items.Add(new ItemInfo(daoyouModelConfig.specialGiftID[index], daoyouModelConfig.specialGiftNum[index]));
 
-                 }
 
-                 daoYouData.awardLevels.Add(_daoyouLevelupConfig.ID);
 
-                 if (items.Count > 0)
 
-                 {
 
-                     PlayerManager.Instance.BagController.AddItem(items);
 
-                     RewardsPanel.OpenPanel(items);
 
-                 }
 
-                 Text_Tips.gameObject.SetActive(true);
 
-                 foreach (var widgetItem in _widgetItems)
 
-                 {
 
-                     widgetItem.transform.RecoverColor();
 
-                     widgetItem.ShowGou();
 
-                 }
 
-                 AccountFileInfo.Instance.SavePlayerData();
 
-             });
 
-         }
 
-         public async void CustomInit(AccountFileInfo.DaoYouData daoYouData, int configId)
 
-         {
 
-             this.daoYouData = daoYouData;
 
-             _daoyouLevelupConfig = ConfigComponent.Instance.Get<DaoyouLevelupConfig>(configId);
 
-             DaoyouModelConfig daoyouModelConfig = ConfigComponent.Instance.Get<DaoyouModelConfig>(daoYouData.id);
 
-             Text_Level.text = configId.ToString();
 
-             Text_Name.text = LanguageManager.Instance.Text(_daoyouLevelupConfig.name);
 
-             for (var i = 0; i < _daoyouLevelupConfig.prizeID?.Length; i++)
 
-             {
 
-                 DaoYouWidgetItem widgetItem = await UIManager.Instance.CreateGComponent<DaoYouWidgetItem>(null, ItemRoot);
 
-                 widgetItem.CustomInit(new ItemInfo(_daoyouLevelupConfig.prizeID[i], _daoyouLevelupConfig.prizeNum[i]));
 
-                 _widgetItems.Add(widgetItem);
 
-             }
 
-             if (daoyouModelConfig.EmotionLvforspecialGift.Contains(configId))
 
-             {
 
-                 int index = daoyouModelConfig.EmotionLvforspecialGift.ToList().IndexOf(configId);
 
-                 DaoYouWidgetItem widgetItem = await UIManager.Instance.CreateGComponent<DaoYouWidgetItem>(null, ItemRoot);
 
-                 widgetItem.CustomInit(new ItemInfo(daoyouModelConfig.specialGiftID[index], daoyouModelConfig.specialGiftNum[index]));
 
-                 _widgetItems.Add(widgetItem);
 
-             }
 
-             //已经领取奖励
 
-             if (daoYouData.awardLevels.Contains(configId))
 
-             {
 
-                 Text_Tips.gameObject.SetActive(true);
 
-                 foreach (var widgetItem in _widgetItems)
 
-                 {
 
-                     widgetItem.transform.RecoverColor();
 
-                     widgetItem.ShowGou();
 
-                 }
 
-             }
 
-             else
 
-             {
 
-                 //可以领取
 
-                 if (daoYouData.favorabilityLv >= _daoyouLevelupConfig.ID)
 
-                 {
 
-                     foreach (var widgetItem in _widgetItems)
 
-                     {
 
-                         widgetItem.transform.RecoverColor();
 
-                         widgetItem.Award();
 
-                     }
 
-                 }
 
-                 //不能领取
 
-                 else
 
-                 {
 
-                     foreach (var widgetItem in _widgetItems)
 
-                     {
 
-                         widgetItem.transform.Gray();
 
-                     }
 
-                 }
 
-                 Text_Tips.gameObject.SetActive(false);
 
-             }
 
-         }
 
-         public override void DormancyObj()
 
-         {
 
-             foreach (var widgetItem in _widgetItems)
 
-             {
 
-                 UIManager.Instance.DormancyGComponent(widgetItem);
 
-             }
 
-             _widgetItems.Clear();
 
-             base.DormancyObj();
 
-         }
 
-     }
 
- }
 
 
  |