|
@@ -78,10 +78,10 @@ namespace GFGGame
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- LuckyBoxBonusDataCache.currentBoxId = boxId;
|
|
|
|
|
|
+ LuckyBoxDataManager.Instance.currentBoxId = boxId;
|
|
isActiveBoxOpen = Array.IndexOf(LuckyBoxDataManager.Instance.luckyBoxIds, LuckyBoxDataManager.BOX_ID_1) >= 0;
|
|
isActiveBoxOpen = Array.IndexOf(LuckyBoxDataManager.Instance.luckyBoxIds, LuckyBoxDataManager.BOX_ID_1) >= 0;
|
|
|
|
|
|
- int index = Array.IndexOf(LuckyBoxDataManager.Instance.luckyBoxIds, LuckyBoxBonusDataCache.currentBoxId);
|
|
|
|
|
|
+ int index = Array.IndexOf(LuckyBoxDataManager.Instance.luckyBoxIds, LuckyBoxDataManager.Instance.currentBoxId);
|
|
_ui.m_listBg.numItems = LuckyBoxDataManager.Instance.luckyBoxIds.Length;
|
|
_ui.m_listBg.numItems = LuckyBoxDataManager.Instance.luckyBoxIds.Length;
|
|
_ui.m_listBg.ScrollToView(index);
|
|
_ui.m_listBg.ScrollToView(index);
|
|
_ui.m_listBg.scrollPane.decelerationRate = 0.8f;
|
|
_ui.m_listBg.scrollPane.decelerationRate = 0.8f;
|
|
@@ -107,7 +107,7 @@ namespace GFGGame
|
|
if (!isActiveBoxOpen)
|
|
if (!isActiveBoxOpen)
|
|
{
|
|
{
|
|
//活动未开启
|
|
//活动未开启
|
|
- LuckyBoxBonusDataCache.currentBoxId = LuckyBoxDataManager.Instance.luckyBoxIds[0];
|
|
|
|
|
|
+ LuckyBoxDataManager.Instance.currentBoxId = LuckyBoxDataManager.Instance.luckyBoxIds[0];
|
|
Timers.inst.Remove(CheckTime);
|
|
Timers.inst.Remove(CheckTime);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -118,12 +118,12 @@ namespace GFGGame
|
|
private void OnListBgScroll()
|
|
private void OnListBgScroll()
|
|
{
|
|
{
|
|
UI_ComListBgItem item = UI_ComListBgItem.Proxy(_ui.m_listBg.GetChildAt(_ui.m_c1.selectedIndex));
|
|
UI_ComListBgItem item = UI_ComListBgItem.Proxy(_ui.m_listBg.GetChildAt(_ui.m_c1.selectedIndex));
|
|
- LuckyBoxBonusDataCache.currentBoxId = LuckyBoxDataManager.Instance.luckyBoxIds[_ui.m_c1.selectedIndex];
|
|
|
|
- item.m_txtTime.visible = LuckyBoxBonusDataCache.currentBoxId == LuckyBoxDataManager.BOX_ID_1;
|
|
|
|
- item.m_imgTitle.visible = LuckyBoxBonusDataCache.currentBoxId == LuckyBoxDataManager.BOX_ID_1;
|
|
|
|
- item.m_holder.visible = isActiveBoxOpen && LuckyBoxBonusDataCache.currentBoxId == LuckyBoxDataManager.BOX_ID_1;
|
|
|
|
- item.m_holder1.visible = isActiveBoxOpen && LuckyBoxBonusDataCache.currentBoxId == LuckyBoxDataManager.BOX_ID_1;
|
|
|
|
- item.m_loaImg.visible = LuckyBoxBonusDataCache.currentBoxId == LuckyBoxDataManager.BOX_ID_3;
|
|
|
|
|
|
+ LuckyBoxDataManager.Instance.currentBoxId = LuckyBoxDataManager.Instance.luckyBoxIds[_ui.m_c1.selectedIndex];
|
|
|
|
+ item.m_txtTime.visible = LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_1;
|
|
|
|
+ item.m_imgTitle.visible = LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_1;
|
|
|
|
+ item.m_holder.visible = isActiveBoxOpen && LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_1;
|
|
|
|
+ item.m_holder1.visible = isActiveBoxOpen && LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_1;
|
|
|
|
+ item.m_loaImg.visible = LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_3;
|
|
|
|
|
|
onClickChange(0);
|
|
onClickChange(0);
|
|
UpdateNormal();
|
|
UpdateNormal();
|
|
@@ -131,8 +131,8 @@ namespace GFGGame
|
|
|
|
|
|
private void UpdateNormal()
|
|
private void UpdateNormal()
|
|
{
|
|
{
|
|
- LuckyBoxCfg luckyBoxCfg = LuckyBoxCfgArray.Instance.GetCfg(LuckyBoxBonusDataCache.currentBoxId);
|
|
|
|
- _valueBarController.UpdateCJ(LuckyBoxBonusDataCache.currentBoxId);
|
|
|
|
|
|
+ LuckyBoxCfg luckyBoxCfg = LuckyBoxCfgArray.Instance.GetCfg(LuckyBoxDataManager.Instance.currentBoxId);
|
|
|
|
+ _valueBarController.UpdateCJ(LuckyBoxDataManager.Instance.currentBoxId);
|
|
|
|
|
|
_ui.m_comCostOne.m_txtCost.text = luckyBoxCfg.costNum.ToString();
|
|
_ui.m_comCostOne.m_txtCost.text = luckyBoxCfg.costNum.ToString();
|
|
_ui.m_comCostTen.m_txtCost.text = luckyBoxCfg.costNumTen.ToString();
|
|
_ui.m_comCostTen.m_txtCost.text = luckyBoxCfg.costNumTen.ToString();
|
|
@@ -140,7 +140,7 @@ namespace GFGGame
|
|
_ui.m_comCostTen.m_loaCost.url = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(luckyBoxCfg.costID).res);
|
|
_ui.m_comCostTen.m_loaCost.url = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(luckyBoxCfg.costID).res);
|
|
|
|
|
|
|
|
|
|
- int count = LuckyBoxBonusDataCache.GetOwnedCount();
|
|
|
|
|
|
+ int count = LuckyBoxDataManager.Instance.GetOwnedCount();
|
|
_ui.m_txtOwned.SetVar("v1", "" + count).FlushVars();
|
|
_ui.m_txtOwned.SetVar("v1", "" + count).FlushVars();
|
|
|
|
|
|
}
|
|
}
|
|
@@ -148,11 +148,11 @@ namespace GFGGame
|
|
private void onClickChange(int count)
|
|
private void onClickChange(int count)
|
|
{
|
|
{
|
|
_ui.m_c1.selectedIndex = _ui.m_c1.selectedIndex + count;
|
|
_ui.m_c1.selectedIndex = _ui.m_c1.selectedIndex + count;
|
|
- _ui.m_imgSpecial.visible = LuckyBoxBonusDataCache.currentBoxId == LuckyBoxDataManager.BOX_ID_1;
|
|
|
|
|
|
+ _ui.m_imgSpecial.visible = LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_1;
|
|
_ui.m_btnRight.visible = _ui.m_c1.selectedIndex != _ui.m_listBg.numItems - 1;
|
|
_ui.m_btnRight.visible = _ui.m_c1.selectedIndex != _ui.m_listBg.numItems - 1;
|
|
_ui.m_btnLeft.visible = _ui.m_c1.selectedIndex != 0;
|
|
_ui.m_btnLeft.visible = _ui.m_c1.selectedIndex != 0;
|
|
- _ui.m_btnBuyOne.m_holder.visible = LuckyBoxBonusDataCache.currentBoxId == LuckyBoxDataManager.BOX_ID_1;
|
|
|
|
- _ui.m_btnBuyTen.m_holder.visible = LuckyBoxBonusDataCache.currentBoxId == LuckyBoxDataManager.BOX_ID_1;
|
|
|
|
|
|
+ _ui.m_btnBuyOne.m_holder.visible = LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_1;
|
|
|
|
+ _ui.m_btnBuyTen.m_holder.visible = LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_1;
|
|
}
|
|
}
|
|
|
|
|
|
private void updateBoxEffect()
|
|
private void updateBoxEffect()
|
|
@@ -174,8 +174,8 @@ namespace GFGGame
|
|
}
|
|
}
|
|
private void OnClickBtnExChange()
|
|
private void OnClickBtnExChange()
|
|
{
|
|
{
|
|
- int storeId = LuckyBoxBonusDataCache.currentBoxId == LuckyBoxDataManager.BOX_ID_1 ? ConstStoreId.LUCKY_BOX_ACTIVITY_STORE_ID : ConstStoreId.LUCKY_BOX_STORE_ID;
|
|
|
|
- ViewManager.Show(ViewName.CLOTHING_SHOP_VIEW, new object[] { storeId }, new object[] { ViewName.LUCKY_BOX_VIEW, LuckyBoxBonusDataCache.currentBoxId });
|
|
|
|
|
|
+ int storeId = LuckyBoxDataManager.Instance.currentBoxId == LuckyBoxDataManager.BOX_ID_1 ? ConstStoreId.LUCKY_BOX_ACTIVITY_STORE_ID : ConstStoreId.LUCKY_BOX_STORE_ID;
|
|
|
|
+ ViewManager.Show(ViewName.CLOTHING_SHOP_VIEW, new object[] { storeId }, new object[] { ViewName.LUCKY_BOX_VIEW, LuckyBoxDataManager.Instance.currentBoxId });
|
|
this.Hide();
|
|
this.Hide();
|
|
}
|
|
}
|
|
private void OnClickBtnPreview()
|
|
private void OnClickBtnPreview()
|
|
@@ -184,24 +184,24 @@ namespace GFGGame
|
|
}
|
|
}
|
|
private void OnClickBtnBuyOne()
|
|
private void OnClickBtnBuyOne()
|
|
{
|
|
{
|
|
- LuckyBoxDataManager.Instance.CheckItemEnough(LuckyBoxBonusDataCache.currentBoxId, LuckyBoxDataManager.ONCE_TIME, async () =>
|
|
|
|
|
|
+ LuckyBoxDataManager.Instance.CheckItemEnough(LuckyBoxDataManager.Instance.currentBoxId, LuckyBoxDataManager.ONCE_TIME, async () =>
|
|
{
|
|
{
|
|
- bool result = await LuckyBoxSProxy.ReqGetBonus(LuckyBoxBonusDataCache.currentBoxId, LuckyBoxDataManager.ONCE_TIME);
|
|
|
|
|
|
+ bool result = await LuckyBoxSProxy.ReqGetBonus(LuckyBoxDataManager.Instance.currentBoxId, LuckyBoxDataManager.ONCE_TIME);
|
|
if (result)
|
|
if (result)
|
|
{
|
|
{
|
|
- ViewManager.Show(ViewName.LUCKY_BOX_STAR_VIEW, LuckyBoxBonusDataCache.currentBoxId, new object[] { ViewName.LUCKY_BOX_VIEW, LuckyBoxBonusDataCache.currentBoxId });
|
|
|
|
|
|
+ ViewManager.Show(ViewName.LUCKY_BOX_STAR_VIEW, LuckyBoxDataManager.Instance.currentBoxId, new object[] { ViewName.LUCKY_BOX_VIEW, LuckyBoxDataManager.Instance.currentBoxId });
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
private void OnClickBtnBuyTen()
|
|
private void OnClickBtnBuyTen()
|
|
{
|
|
{
|
|
- LuckyBoxDataManager.Instance.CheckItemEnough(LuckyBoxBonusDataCache.currentBoxId, LuckyBoxDataManager.TEN_TIME, async () =>
|
|
|
|
|
|
+ LuckyBoxDataManager.Instance.CheckItemEnough(LuckyBoxDataManager.Instance.currentBoxId, LuckyBoxDataManager.TEN_TIME, async () =>
|
|
{
|
|
{
|
|
- bool result = await LuckyBoxSProxy.ReqGetBonus(LuckyBoxBonusDataCache.currentBoxId, LuckyBoxDataManager.TEN_TIME);
|
|
|
|
|
|
+ bool result = await LuckyBoxSProxy.ReqGetBonus(LuckyBoxDataManager.Instance.currentBoxId, LuckyBoxDataManager.TEN_TIME);
|
|
if (result)
|
|
if (result)
|
|
{
|
|
{
|
|
- ViewManager.Show(ViewName.LUCKY_BOX_STAR_VIEW, LuckyBoxBonusDataCache.currentBoxId, new object[] { ViewName.LUCKY_BOX_VIEW, LuckyBoxBonusDataCache.currentBoxId });
|
|
|
|
|
|
+ ViewManager.Show(ViewName.LUCKY_BOX_STAR_VIEW, LuckyBoxDataManager.Instance.currentBoxId, new object[] { ViewName.LUCKY_BOX_VIEW, LuckyBoxDataManager.Instance.currentBoxId });
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -232,7 +232,7 @@ namespace GFGGame
|
|
}
|
|
}
|
|
private void Reset()
|
|
private void Reset()
|
|
{
|
|
{
|
|
- LuckyBoxBonusDataCache.currentBoxId = LuckyBoxDataManager.BOX_ID_1;
|
|
|
|
|
|
+ LuckyBoxDataManager.Instance.currentBoxId = LuckyBoxDataManager.BOX_ID_1;
|
|
}
|
|
}
|
|
protected override void UpdateToCheckGuide(object param)
|
|
protected override void UpdateToCheckGuide(object param)
|
|
{
|
|
{
|