|
@@ -84,7 +84,7 @@ namespace GFGGame
|
|
|
_ui.m_btnRight.onClick.Add(OnBtnRightClick);
|
|
|
|
|
|
_ui.m_listBg.itemRenderer = RenderListBgItem;
|
|
|
- _ui.m_listBg.SetVirtualAndLoop();
|
|
|
+ _ui.m_listBg.SetVirtualAndLoop(); //虚拟循环列表
|
|
|
_ui.m_listBg.scrollPane.onScrollEnd.Add(OnScrollEnd);
|
|
|
_ui.m_loaBg.url = ResPathUtil.GetBgImgPath("zx_bg");
|
|
|
}
|
|
@@ -165,8 +165,8 @@ namespace GFGGame
|
|
|
|
|
|
private void RenderListBgItem(int index, GObject obj)
|
|
|
{
|
|
|
- UI_ComBox1 comBox = UI_ComBox1.Proxy(obj);
|
|
|
int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[index];
|
|
|
+ UI_ComBox1 comBox = UI_ComBox1.Proxy(obj);
|
|
|
LuckyBoxCfg cfg = LuckyBoxCfgArray.Instance.GetCfg(boxId);
|
|
|
LuckyBoxDataManager.Instance.InitData(boxId);
|
|
|
if(!_listActivityBtnObj.ContainsKey(boxId))
|
|
@@ -196,22 +196,6 @@ namespace GFGGame
|
|
|
}
|
|
|
|
|
|
_luckyBoxCtrl.Add(boxId, new LuckyBoxController(comBox.m_comModel.target));
|
|
|
-
|
|
|
- if (boxId != LuckyBoxDataManager.BOX_ID_3)
|
|
|
- {
|
|
|
- if (!_effectUIDic.ContainsKey("Button_Text_DianCang" + boxId))
|
|
|
- {
|
|
|
- _effectUIDic.Add("Button_Text_DianCang" + boxId, EffectUIPool.CreateEffectUI(comBox.m_comLuckBoxBtn.m_Special_eff, "ui_LuckyBox", "Button_Text_DianCang"));
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (_effectUIDic.ContainsKey("Button_Text_DianCang" + boxId))
|
|
|
- {
|
|
|
- EffectUIPool.Recycle(_effectUIDic["Button_Text_DianCang" + boxId]);
|
|
|
- _effectUIDic.Remove("Button_Text_DianCang" + boxId);
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
comBox.m_comLuckBoxBtn.m_holder.visible = boxId != LuckyBoxDataManager.BOX_ID_3;
|
|
|
comBox.m_comLuckBoxBtn.m_comCostOne.m_txtCost.text = cfg.costNum.ToString();
|
|
@@ -224,34 +208,24 @@ namespace GFGGame
|
|
|
comBox.m_comLuckBoxBtn.m_comCostFifty.m_loaCost.url = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(cfg.costID).res);
|
|
|
|
|
|
if (comBox.m_comLuckBoxBtn.m_btnBuyOne.data == null)
|
|
|
- {
|
|
|
comBox.m_comLuckBoxBtn.m_btnBuyOne.onClick.Add(OnClickBtnBuyOne);
|
|
|
- }
|
|
|
comBox.m_comLuckBoxBtn.m_btnBuyOne.data = boxId;
|
|
|
|
|
|
if (comBox.m_comLuckBoxBtn.m_btnBuyTen.data == null)
|
|
|
{
|
|
|
- string strKey = "Button_public" + boxId;
|
|
|
- if (_effectUIDic.ContainsKey(strKey)) {
|
|
|
- EffectUIPool.Recycle(_effectUIDic[strKey]);
|
|
|
- _effectUIDic.Remove(strKey);
|
|
|
- }
|
|
|
+ _effectUIDic.Add("Button_Text_DianCang" + boxId, EffectUIPool.CreateEffectUI(comBox.m_comLuckBoxBtn.m_Special_eff, "ui_LuckyBox", "Button_Text_DianCang"));
|
|
|
+ _effectUIDic.Add("Button_public" + boxId, EffectUIPool.CreateEffectUI(comBox.m_comLuckBoxBtn.m_btnBuyTen_eff, "ui_LuckyBox", "Button_public"));
|
|
|
+
|
|
|
comBox.m_comLuckBoxBtn.m_btnBuyTen.onClick.Add(OnClickBtnBuyTen);
|
|
|
- _effectUIDic.Add(strKey, EffectUIPool.CreateEffectUI(comBox.m_comLuckBoxBtn.m_btnBuyTen_eff, "ui_LuckyBox", "Button_public"));
|
|
|
}
|
|
|
comBox.m_comLuckBoxBtn.m_btnBuyTen.data = boxId;
|
|
|
|
|
|
if (comBox.m_comLuckBoxBtn.m_btnBuyFifty.data == null)
|
|
|
- {
|
|
|
comBox.m_comLuckBoxBtn.m_btnBuyFifty.onClick.Add(OnClickBtnBuyFifty);
|
|
|
- }
|
|
|
comBox.m_comLuckBoxBtn.m_btnBuyFifty.data = boxId;
|
|
|
-
|
|
|
|
|
|
if (comBox.m_btnPreview.data == null)
|
|
|
- {
|
|
|
comBox.m_btnPreview.onClick.Add(OnClickBtnPreview);
|
|
|
- }
|
|
|
comBox.m_btnPreview.data = boxId;
|
|
|
|
|
|
if (comBox.m_btnReward.data == null)
|
|
@@ -263,7 +237,6 @@ namespace GFGGame
|
|
|
comBox.m_btnReward.data = boxId;
|
|
|
|
|
|
obj.data = boxId;
|
|
|
-
|
|
|
comBox.m_grpTime.visible = (boxId == _activeBoxId);
|
|
|
if (boxId == _activeBoxId)
|
|
|
{
|
|
@@ -273,7 +246,6 @@ namespace GFGGame
|
|
|
string strTime = time > TimeUtil.SECOND_PER_DAY * 100 ? TimeUtil.FormattingTimeTo_DDHHmm(time) : TimeUtil.FormattingTimeTo_HHmmss(time);
|
|
|
comBox.m_txtTime.text = string.Format("轮换倒计时:{0}", strTime);
|
|
|
}
|
|
|
-
|
|
|
UI_ComBox1.ProxyEnd();
|
|
|
}
|
|
|
|