|  | @@ -10,6 +10,8 @@ namespace GFGGame
 | 
	
		
			
				|  |  |          private UI_LuckBoxBonusUI _ui;
 | 
	
		
			
				|  |  |          private List<ItemData> itemList;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +        private int openCount = 0;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          private List<GameObject> _effects = new List<GameObject>();
 | 
	
		
			
				|  |  |          private List<GoWrapper> _wrappers = new List<GoWrapper>();
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -41,51 +43,33 @@ namespace GFGGame
 | 
	
		
			
				|  |  |              isfullScreen = true;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              InitAllItem();
 | 
	
		
			
				|  |  | -            _ui.m_loaBg.touchable = false;
 | 
	
		
			
				|  |  |              _ui.m_loaBg.onClick.Add(OnClickBg);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -            string resPath = ResPathUtil.GetViewEffectPath("ui_ck", "ui_ck_zl");
 | 
	
		
			
				|  |  | -            for (int i = 0; i < 10; i++)
 | 
	
		
			
				|  |  | -            {
 | 
	
		
			
				|  |  | -                GameObject gameObject0;
 | 
	
		
			
				|  |  | -                GoWrapper wrapper0;
 | 
	
		
			
				|  |  | -                GGraph holder = _ui.target.GetChild("item" + i).asCom.GetChild("holder").asGraph;
 | 
	
		
			
				|  |  | -                SceneController.AddObjectToView(null, null, holder, resPath, out gameObject0, out wrapper0);
 | 
	
		
			
				|  |  | -                _effects.Add(gameObject0);
 | 
	
		
			
				|  |  | -                _wrappers.Add(wrapper0);
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -            GGraph holder1 = _ui.target.GetChild("itemOne").asCom.GetChild("holder").asGraph;
 | 
	
		
			
				|  |  | -            SceneController.AddObjectToView(null, null, holder1, resPath, out _effect, out _wrapper);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +            _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("bj_ckzxin");
 | 
	
		
			
				|  |  | +            _ui.m_loaOpen.onClick.Add(OnClickOpen);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          protected override void OnShown()
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  |              base.OnShown();
 | 
	
		
			
				|  |  | -            _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("gxhd_bjbj");
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              itemList = (viewData as object[])[0] as List<ItemData>;
 | 
	
		
			
				|  |  |              if (itemList != null)
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  | -                _ui.m_loaBg.touchable = false;
 | 
	
		
			
				|  |  | +                _ui.m_loaOpen.visible = true;
 | 
	
		
			
				|  |  |                  int count = itemList.Count;
 | 
	
		
			
				|  |  |                  if (count == 10)
 | 
	
		
			
				|  |  |                  {
 | 
	
		
			
				|  |  | -                    ShowBonusList(itemList);
 | 
	
		
			
				|  |  | +                    _ui.m_c1.selectedIndex = 1;
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |                  else if (count > 0)
 | 
	
		
			
				|  |  |                  {
 | 
	
		
			
				|  |  | -                    ShowBonus(itemList[0]);
 | 
	
		
			
				|  |  | +                    _ui.m_c1.selectedIndex = 0;
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  | -                else
 | 
	
		
			
				|  |  | -                {
 | 
	
		
			
				|  |  | -                    _ui.m_loaBg.touchable = true;
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +                ShowBonusList();
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              else
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  | -                _ui.m_loaBg.touchable = true;
 | 
	
		
			
				|  |  | +                _ui.m_loaOpen.visible = false;
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -101,41 +85,23 @@ namespace GFGGame
 | 
	
		
			
				|  |  |              GetSuitItemController.TryShow(0);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        private void ShowBonusList(List<ItemData> itemList)
 | 
	
		
			
				|  |  | +        private void ShowBonusList()
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  | -            HideAllItem();
 | 
	
		
			
				|  |  | -            for (int i = 0; i < 10; i++)
 | 
	
		
			
				|  |  | +            if (itemList.Count > 1)
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  | -                ItemData itemData = itemList[i];
 | 
	
		
			
				|  |  | -                GObject itemObject = _ui.target.GetChild("item" + i);
 | 
	
		
			
				|  |  | -                if (itemObject != null)
 | 
	
		
			
				|  |  | +                for (int i = 0; i < itemList.Count; i++)
 | 
	
		
			
				|  |  |                  {
 | 
	
		
			
				|  |  | -                    UI_LuckyBoxBonusItem itemUI = UI_LuckyBoxBonusItem.Proxy(itemObject);
 | 
	
		
			
				|  |  | -                    UpdateItem(itemUI, itemData, i);
 | 
	
		
			
				|  |  | -                    UI_LuckyBoxBonusItem.ProxyEnd();
 | 
	
		
			
				|  |  | -                    Timers.inst.Add(0.3f * i, 1, (object param) =>
 | 
	
		
			
				|  |  | +                    GObject itemObject = _ui.target.GetChild("item" + i);
 | 
	
		
			
				|  |  | +                    if (itemObject != null)
 | 
	
		
			
				|  |  |                      {
 | 
	
		
			
				|  |  | -                        itemObject.visible = true;
 | 
	
		
			
				|  |  | -                        if ((int)param == 9)
 | 
	
		
			
				|  |  | -                        {
 | 
	
		
			
				|  |  | -                            Timers.inst.Add(0.1f, 1, (object param) =>
 | 
	
		
			
				|  |  | -                            {
 | 
	
		
			
				|  |  | -                                _ui.m_loaBg.touchable = true;
 | 
	
		
			
				|  |  | -                            });
 | 
	
		
			
				|  |  | -                        }
 | 
	
		
			
				|  |  | -                    }, i);
 | 
	
		
			
				|  |  | +                        UpdateItem(i, itemObject);
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -        private void ShowBonus(ItemData itemData)
 | 
	
		
			
				|  |  | -        {
 | 
	
		
			
				|  |  | -            HideAllItem();
 | 
	
		
			
				|  |  | -            _ui.m_itemOne.target.visible = true;
 | 
	
		
			
				|  |  | -            UI_LuckyBoxBonusItem itemUI = UI_LuckyBoxBonusItem.Proxy(_ui.m_itemOne.target);
 | 
	
		
			
				|  |  | -            UpdateItem(itemUI, itemData, 0);
 | 
	
		
			
				|  |  | -            UI_LuckyBoxBonusItem.ProxyEnd();
 | 
	
		
			
				|  |  | -            _ui.m_loaBg.touchable = true;
 | 
	
		
			
				|  |  | +            else
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                UpdateItem(0, _ui.m_itemOne.target);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          private void HideAllItem()
 | 
	
	
		
			
				|  | @@ -151,10 +117,11 @@ namespace GFGGame
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        private void UpdateItem(UI_LuckyBoxBonusItem itemUI, ItemData itemData, int index)
 | 
	
		
			
				|  |  | +        private void UpdateItem(int index, GObject obj)
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  | +            ItemData itemData = itemList[index];
 | 
	
		
			
				|  |  | +            UI_LuckyBoxBonusItem itemUI = UI_LuckyBoxBonusItem.Proxy(obj);
 | 
	
		
			
				|  |  |              ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemData.id);
 | 
	
		
			
				|  |  | -            itemUI.m_comIcon.m_icon.url = ResPathUtil.GetIconPath(itemCfg);
 | 
	
		
			
				|  |  |              bool isFirst = true;
 | 
	
		
			
				|  |  |              int count = 0;
 | 
	
		
			
				|  |  |              for (int i = 0; i < itemList.Count; i++)
 | 
	
	
		
			
				|  | @@ -169,6 +136,7 @@ namespace GFGGame
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +            itemUI.m_comIcon.m_icon.url = ResPathUtil.GetIconPath(itemCfg);
 | 
	
		
			
				|  |  |              itemUI.m_comIcon.m_imgNew.visible = ItemDataManager.GetItemNum(itemData.id) == count && isFirst ? true : false;
 | 
	
		
			
				|  |  |              string itemName = itemCfg.name;
 | 
	
		
			
				|  |  |              if (itemData.num > 1)
 | 
	
	
		
			
				|  | @@ -179,28 +147,69 @@ namespace GFGGame
 | 
	
		
			
				|  |  |              itemUI.m_c1.selectedIndex = itemCfg.rarity;
 | 
	
		
			
				|  |  |              itemUI.m_comIcon.m_c1.selectedIndex = itemCfg.rarity;
 | 
	
		
			
				|  |  |              RarityIconController.UpdateRarityIcon(itemUI.m_comIcon.m_rarity, itemData.id, false);
 | 
	
		
			
				|  |  | -            itemUI.target.data = itemData.id;
 | 
	
		
			
				|  |  | -            itemUI.m_comIcon.target.SetScale(0, 0);
 | 
	
		
			
				|  |  | +            itemUI.m_comIcon.m_icon.data = itemData.id;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            // itemUI.m_comIcon.target.SetScale(0, 0);
 | 
	
		
			
				|  |  |              itemUI.m_t0.Play();
 | 
	
		
			
				|  |  | -            // GTween.To(0, 1, 0.2f).SetTarget(itemUI).OnUpdate((GTweener t) => { itemUI.target.SetScale(t.value.x, t.value.x); });
 | 
	
		
			
				|  |  | +            UI_LuckyBoxBonusItem.ProxyEnd();
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          private void InitAllItem()
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  | -            _ui.m_itemOne.target.onClick.Add(OnClickItemUI);
 | 
	
		
			
				|  |  | +            UI_LuckyBoxBonusItem itemUI = UI_LuckyBoxBonusItem.Proxy(_ui.m_itemOne.target);
 | 
	
		
			
				|  |  | +            itemUI.target.onClick.Add(OnClickItem);
 | 
	
		
			
				|  |  | +            itemUI.m_comIcon.m_icon.onClick.Add(OnClickItemTips);
 | 
	
		
			
				|  |  | +            UI_LuckyBoxBonusItem.ProxyEnd();
 | 
	
		
			
				|  |  |              for (int i = 0; i < 10; i++)
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  |                  GObject itemObject = _ui.target.GetChild("item" + i);
 | 
	
		
			
				|  |  |                  if (itemObject != null)
 | 
	
		
			
				|  |  |                  {
 | 
	
		
			
				|  |  | -                    itemObject.onClick.Add(OnClickItemUI);
 | 
	
		
			
				|  |  | +                    UI_LuckyBoxBonusItem itemUITen = UI_LuckyBoxBonusItem.Proxy(itemObject);
 | 
	
		
			
				|  |  | +                    itemUITen.target.onClick.Add(OnClickItem);
 | 
	
		
			
				|  |  | +                    itemUITen.m_comIcon.m_icon.onClick.Add(OnClickItemTips);
 | 
	
		
			
				|  |  | +                    UI_LuckyBoxBonusItem.ProxyEnd();
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        private void OnClickItemUI(EventContext context)
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        private void OnClickItem(EventContext context)
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  |              GComponent item = context.sender as GComponent;
 | 
	
		
			
				|  |  | +            PlayOpenAni(item);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        private void OnClickOpen()
 | 
	
		
			
				|  |  | +        {
 | 
	
		
			
				|  |  | +            for (int i = 0; i < itemList.Count; i++)
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                GComponent component = _ui.target.GetChild("item" + i).asCom;
 | 
	
		
			
				|  |  | +                if (component != null)
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    bool playing = PlayOpenAni(component);
 | 
	
		
			
				|  |  | +                    if (!playing) continue;
 | 
	
		
			
				|  |  | +                    if (playing) break;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        private bool PlayOpenAni(GComponent component)
 | 
	
		
			
				|  |  | +        {
 | 
	
		
			
				|  |  | +            Transition transition = component.GetTransition("t1");
 | 
	
		
			
				|  |  | +            GComponent comIcon = component.GetChild("comIcon").asCom;
 | 
	
		
			
				|  |  | +            if (transition.playing || comIcon.skew == Vector2.zero) return false;
 | 
	
		
			
				|  |  | +            transition.Play(UpdateOpenCount);
 | 
	
		
			
				|  |  | +            return true;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        private void UpdateOpenCount()
 | 
	
		
			
				|  |  | +        {
 | 
	
		
			
				|  |  | +            openCount++;
 | 
	
		
			
				|  |  | +            if (openCount == itemList.Count)
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                _ui.m_loaOpen.visible = false;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        private void OnClickItemTips(EventContext context)
 | 
	
		
			
				|  |  | +        {
 | 
	
		
			
				|  |  | +            GLoader item = context.sender as GLoader;
 | 
	
		
			
				|  |  |              int itemID = (int)item.data;
 | 
	
		
			
				|  |  |              GoodsItemTipsController.ShowItemTips(itemID);
 | 
	
		
			
				|  |  |          }
 |