| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 | 
							- using System.Collections.Generic;
 
- using FairyGUI;
 
- using UI.Task;
 
- namespace GFGGame
 
- {
 
-     public class BuyBattlePassLevelView : BaseWindow
 
-     {
 
-         private UI_BuyBattlePassLevelUI _ui;
 
-         private int addLevel = 1;
 
-         public override void Dispose()
 
-         {
 
-             if (_ui != null)
 
-             {
 
-                 _ui.Dispose();
 
-                 _ui = null;
 
-             }
 
-             base.Dispose();
 
-         }
 
-         protected override void OnInit()
 
-         {
 
-             base.OnInit();
 
-             packageName = UI_OpenBattlePassUI.PACKAGE_NAME;
 
-             _ui = UI_BuyBattlePassLevelUI.Create();
 
-             viewCom = _ui.target;
 
-             viewCom.Center();
 
-             _ui.m_CloseBtn.onClick.Add(Hide);
 
-             // clickBlankToClose = false;
 
-             _ui.m_Rewards.itemRenderer = SpecialRewardRender;
 
-             _ui.m_Add.onClick.Add(OnAddLevel);
 
-             _ui.m_Reduce.onClick.Add(OnReduceLevel);
 
-         }
 
-         protected override void OnShown()
 
-         {
 
-             setLevel();
 
-             base.OnShown();
 
-         }
 
-         private static void SpecialRewardRender(int index, GObject obj)
 
-         {
 
-             var item = UI_RewardIconYellow.Proxy(obj);
 
-             var itemInfos = (List<KeyValuePair<int, long>>)obj.parent.data;
 
-             // if (!(obj.parent.data is int[][] parentData))
 
-             // {
 
-             //     UI_RewardIconYellow.ClearProxy();
 
-             //     return;
 
-             // }
 
-             var itemInfo = itemInfos[index];
 
-             var itemId = itemInfo.Key;
 
-             var num = itemInfo.Value;
 
-             var itemCfg = ItemCfgArray.Instance.GetCfg(itemId);
 
-             if (itemCfg != null)
 
-             {
 
-                 item.m_loaIcon.url = ResPathUtil.GetCommonGameResPath(itemCfg.res);
 
-                 item.m_num.text = num.ToString();
 
-             }
 
-             UI_RewardIconYellow.ProxyEnd();
 
-         }
 
-         private void setLevel()
 
-         {
 
-             var battlePassLevel = BattlePassTaskDataManager.Instance.GetBattlePassLevel();
 
-             _ui.m_Tip.SetVar("StartLevel", battlePassLevel.ToString())
 
-                 .SetVar("EndLevel", (battlePassLevel + addLevel).ToString()).FlushVars();
 
-             // GlobalCfgArray.globalCfg.
 
-             // _ui.m_Value.text = (addLevel * BattlePassTaskDataManager.Instance.GetBattlePassLevelPrice()).ToString();
 
-         }
 
-         private void OnReduceLevel(EventContext context)
 
-         {
 
-         }
 
-         private void OnAddLevel(EventContext context)
 
-         {
 
-         }
 
-     }
 
- }
 
 
  |