|
@@ -133,7 +133,7 @@ namespace GFGGame
|
|
|
|
|
|
Timers.inst.AddUpdate(CheckGuide);
|
|
Timers.inst.AddUpdate(CheckGuide);
|
|
|
|
|
|
- Timers.inst.Add(0.1f, 0, OnTimerUpdate, 1);
|
|
|
|
|
|
+ Timers.inst.Add(1f, 0, OnTimerUpdate, 1);
|
|
}
|
|
}
|
|
|
|
|
|
private void OnTimerUpdate(object param)
|
|
private void OnTimerUpdate(object param)
|
|
@@ -144,11 +144,12 @@ namespace GFGGame
|
|
UI_ComBox1 comBox = UI_ComBox1.Proxy(obj);
|
|
UI_ComBox1 comBox = UI_ComBox1.Proxy(obj);
|
|
if (freeTime > 0)
|
|
if (freeTime > 0)
|
|
{
|
|
{
|
|
- if (freeTime > TimeHelper.ClientNow())
|
|
|
|
|
|
+ long timeDifference = freeTime - TimeHelper.ClientNow();
|
|
|
|
+ if (timeDifference> 0)
|
|
{
|
|
{
|
|
comBox.m_comLuckBoxBtn.m_comCostOne.m_c1.selectedIndex = 0;
|
|
comBox.m_comLuckBoxBtn.m_comCostOne.m_c1.selectedIndex = 0;
|
|
comBox.m_comLuckBoxBtn.m_txtFreeTime.visible = true;
|
|
comBox.m_comLuckBoxBtn.m_txtFreeTime.visible = true;
|
|
- string strFreeTime = TimeUtil.FormattingTimeTo_HHmmss(freeTime - TimeHelper.ClientNow());
|
|
|
|
|
|
+ string strFreeTime = TimeUtil.FormattingTimeTo_HHmmss(timeDifference);
|
|
comBox.m_comLuckBoxBtn.m_txtFreeTime.text = string.Format("{0}后免费", strFreeTime);
|
|
comBox.m_comLuckBoxBtn.m_txtFreeTime.text = string.Format("{0}后免费", strFreeTime);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
@@ -157,11 +158,6 @@ namespace GFGGame
|
|
comBox.m_comLuckBoxBtn.m_txtFreeTime.visible = false;
|
|
comBox.m_comLuckBoxBtn.m_txtFreeTime.visible = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- //else
|
|
|
|
- //{
|
|
|
|
- // comBox.m_comLuckBoxBtn.m_comCostOne.m_c1.selectedIndex = 0;
|
|
|
|
- // comBox.m_comLuckBoxBtn.m_txtFreeTime.visible = false;
|
|
|
|
- //}
|
|
|
|
|
|
|
|
UI_ComBox1.ProxyEnd();
|
|
UI_ComBox1.ProxyEnd();
|
|
}
|
|
}
|
|
@@ -327,7 +323,10 @@ namespace GFGGame
|
|
GObject obj = context.sender as GObject;
|
|
GObject obj = context.sender as GObject;
|
|
int boxId = (int)obj.data;
|
|
int boxId = (int)obj.data;
|
|
LuckyBoxCfg luckyBoxCfg = LuckyBoxCfgArray.Instance.GetCfg(boxId);
|
|
LuckyBoxCfg luckyBoxCfg = LuckyBoxCfgArray.Instance.GetCfg(boxId);
|
|
|
|
+ long freeTime = LuckyBoxDataManager.Instance.GetFreeTime(boxId);
|
|
|
|
+
|
|
int boughtCount = GameGlobal.myNumericComponent.GetAsInt(luckyBoxCfg.numericType);
|
|
int boughtCount = GameGlobal.myNumericComponent.GetAsInt(luckyBoxCfg.numericType);
|
|
|
|
+
|
|
if (boughtCount + LuckyBoxDataManager.ONCE_TIME > luckyBoxCfg.maxCount)
|
|
if (boughtCount + LuckyBoxDataManager.ONCE_TIME > luckyBoxCfg.maxCount)
|
|
{
|
|
{
|
|
PromptController.Instance.ShowFloatTextPrompt("抽奖次数不足");
|
|
PromptController.Instance.ShowFloatTextPrompt("抽奖次数不足");
|
|
@@ -335,13 +334,12 @@ namespace GFGGame
|
|
}
|
|
}
|
|
LuckyBoxDataManager.Instance.CheckItemEnough(boxId, LuckyBoxDataManager.ONCE_TIME, async () =>
|
|
LuckyBoxDataManager.Instance.CheckItemEnough(boxId, LuckyBoxDataManager.ONCE_TIME, async () =>
|
|
{
|
|
{
|
|
- long freeTime = LuckyBoxDataManager.Instance.GetFreeTime(boxId);
|
|
|
|
bool result = false;
|
|
bool result = false;
|
|
- if (freeTime > 0 && freeTime > TimeHelper.ClientNow())
|
|
|
|
|
|
+ if (freeTime > 0 && freeTime < TimeHelper.ClientNow())
|
|
result = await LuckyBoxSProxy.ReqGetBonus(boxId, LuckyBoxDataManager.ONCE_TIME, true);
|
|
result = await LuckyBoxSProxy.ReqGetBonus(boxId, LuckyBoxDataManager.ONCE_TIME, true);
|
|
else
|
|
else
|
|
result = await LuckyBoxSProxy.ReqGetBonus(boxId, LuckyBoxDataManager.ONCE_TIME);
|
|
result = await LuckyBoxSProxy.ReqGetBonus(boxId, LuckyBoxDataManager.ONCE_TIME);
|
|
-
|
|
|
|
|
|
+
|
|
if (result)
|
|
if (result)
|
|
{
|
|
{
|
|
ViewManager.Show<LuckyBoxStarView>(null, new object[] { ViewName.LUCKY_BOX_VIEW, boxId });
|
|
ViewManager.Show<LuckyBoxStarView>(null, new object[] { ViewName.LUCKY_BOX_VIEW, boxId });
|
|
@@ -454,7 +452,6 @@ namespace GFGGame
|
|
|
|
|
|
private void UpdateFreeInfo()
|
|
private void UpdateFreeInfo()
|
|
{
|
|
{
|
|
- ET.Log.Debug("打印测试-------运行一次ddd---");
|
|
|
|
int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[_curIndex];
|
|
int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[_curIndex];
|
|
LuckyBoxCfg cfg = LuckyBoxCfgArray.Instance.GetCfg(boxId);
|
|
LuckyBoxCfg cfg = LuckyBoxCfgArray.Instance.GetCfg(boxId);
|
|
long freeTime = LuckyBoxDataManager.Instance.GetFreeTime(boxId);
|
|
long freeTime = LuckyBoxDataManager.Instance.GetFreeTime(boxId);
|