|
@@ -59,7 +59,7 @@ namespace GFGGame
|
|
protected override void AddEventListener()
|
|
protected override void AddEventListener()
|
|
{
|
|
{
|
|
base.AddEventListener();
|
|
base.AddEventListener();
|
|
- EventAgent.AddEventListener(ConstMessage.ACTIVITY_LUCKY_BOX, UpdateListItemData);
|
|
|
|
|
|
+ EventAgent.AddEventListener(ConstMessage.ACTIVITY_LUCKY_BOX, UpdateView);
|
|
EventAgent.AddEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);
|
|
EventAgent.AddEventListener(ConstMessage.RED_CHANGE, UpdateRedDot);
|
|
|
|
|
|
}
|
|
}
|
|
@@ -77,7 +77,6 @@ namespace GFGGame
|
|
UpGiftBox();
|
|
UpGiftBox();
|
|
Timers.inst.Add(1, 0, UpdateTime);
|
|
Timers.inst.Add(1, 0, UpdateTime);
|
|
UpdateView();
|
|
UpdateView();
|
|
- UpdateListItemData();
|
|
|
|
UpdateRedDot();
|
|
UpdateRedDot();
|
|
}
|
|
}
|
|
private void UpdateTime(object param = null)
|
|
private void UpdateTime(object param = null)
|
|
@@ -105,10 +104,9 @@ namespace GFGGame
|
|
//=====限时礼包倒计时END
|
|
//=====限时礼包倒计时END
|
|
}
|
|
}
|
|
|
|
|
|
- private void UpdateView()
|
|
|
|
|
|
+ private void UpdateListItemData()
|
|
{
|
|
{
|
|
- _ui.m_txtCount.SetVar("value", ActivityDataManager.Instance.lastDrawCount.ToString()).FlushVars();
|
|
|
|
- _ui.m_txtCount.SetVar("name", _luckyBoxCfg.name).FlushVars();
|
|
|
|
|
|
+
|
|
UI_ComBox comBox = UI_ComBox.Proxy(_ui.m_comBox.target);
|
|
UI_ComBox comBox = UI_ComBox.Proxy(_ui.m_comBox.target);
|
|
|
|
|
|
LuckyBoxDataManager.Instance.InitData(_luckyBoxCfg.id);
|
|
LuckyBoxDataManager.Instance.InitData(_luckyBoxCfg.id);
|
|
@@ -141,8 +139,10 @@ namespace GFGGame
|
|
comBox.target.data = _luckyBoxCfg.id;
|
|
comBox.target.data = _luckyBoxCfg.id;
|
|
|
|
|
|
UI_ComBox.ProxyEnd();
|
|
UI_ComBox.ProxyEnd();
|
|
|
|
+
|
|
|
|
+ UpdateListItemData();
|
|
}
|
|
}
|
|
- private void UpdateListItemData()
|
|
|
|
|
|
+ private void UpdateView()
|
|
{
|
|
{
|
|
UI_ComBox comBox = UI_ComBox.Proxy(_ui.m_comBox.target);
|
|
UI_ComBox comBox = UI_ComBox.Proxy(_ui.m_comBox.target);
|
|
LuckyBoxDataManager.Instance.GetOwnedCount(_luckyBoxCfg.id, out int count, out int totalCount);
|
|
LuckyBoxDataManager.Instance.GetOwnedCount(_luckyBoxCfg.id, out int count, out int totalCount);
|
|
@@ -151,14 +151,14 @@ namespace GFGGame
|
|
int boughtCount = GameGlobal.myNumericComponent.GetAsInt(_luckyBoxCfg.numericType);
|
|
int boughtCount = GameGlobal.myNumericComponent.GetAsInt(_luckyBoxCfg.numericType);
|
|
comBox.m_txtRemainTimes.text = string.Format("今日剩余次数:{0}", _luckyBoxCfg.maxCount - boughtCount);
|
|
comBox.m_txtRemainTimes.text = string.Format("今日剩余次数:{0}", _luckyBoxCfg.maxCount - boughtCount);
|
|
UI_ComBox.ProxyEnd();
|
|
UI_ComBox.ProxyEnd();
|
|
|
|
+ _ui.m_txtCount.SetVar("value", ActivityDataManager.Instance.lastDrawCount.ToString()).FlushVars();
|
|
|
|
+ _ui.m_txtCount.SetVar("name", _luckyBoxCfg.name).FlushVars();
|
|
}
|
|
}
|
|
private void UpGiftBox()
|
|
private void UpGiftBox()
|
|
{
|
|
{
|
|
- var activityInfoByTypeList =
|
|
|
|
- ActivityGlobalDataManager.Instance.GetActivityInfoByType(ActivityType.XSLB3);
|
|
|
|
|
|
+ var activityInfoByTypeList = ActivityGlobalDataManager.Instance.GetActivityInfoByType(ActivityType.XSLB3);
|
|
|
|
|
|
- var list = activityInfoByTypeList
|
|
|
|
- .Where(a => a.EndTime > TimeInfo.Instance.ServerNow()).ToList();
|
|
|
|
|
|
+ var list = activityInfoByTypeList.Where(a => a.EndTime > TimeInfo.Instance.ServerNow()).ToList();
|
|
if (list.Count == 0)
|
|
if (list.Count == 0)
|
|
{
|
|
{
|
|
_ui.m_comBagTime.target.visible = false;
|
|
_ui.m_comBagTime.target.visible = false;
|