|
@@ -53,7 +53,7 @@ namespace GFGGame
|
|
|
this.viewCom = _ui.target;
|
|
|
isfullScreen = true;
|
|
|
|
|
|
- _ui.m_txtRemainTimes.visible = false;
|
|
|
+ // _ui.m_txtRemainTimes.visible = false;
|
|
|
_valueBarController = new ValueBarController(_ui.m_valueBar);
|
|
|
_ui.m_btnBack.onClick.Add(OnClickBtnBack);
|
|
|
_ui.m_btnHome.onClick.Add(OnClickBtnHome);
|
|
@@ -111,6 +111,7 @@ namespace GFGGame
|
|
|
_valueBarController.OnShown();
|
|
|
_valueBarController.Controller(4);
|
|
|
|
|
|
+
|
|
|
// onClickChange(0);
|
|
|
// UpdateNormal();
|
|
|
OnListBgScroll();
|
|
@@ -178,6 +179,8 @@ namespace GFGGame
|
|
|
int count = LuckyBoxDataManager.Instance.GetOwnedCount();
|
|
|
_ui.m_txtOwned.SetVar("v1", "" + count).FlushVars();
|
|
|
|
|
|
+ int boughtCount = GameGlobal.myNumericComponent.GetAsInt(luckyBoxCfg.numericType);
|
|
|
+ _ui.m_txtRemainTimes.text = string.Format("今日剩余次数:{0}", luckyBoxCfg.maxCount - boughtCount);
|
|
|
}
|
|
|
|
|
|
private void onClickChange(int count)
|
|
@@ -220,6 +223,13 @@ namespace GFGGame
|
|
|
}
|
|
|
private void OnClickBtnBuyOne()
|
|
|
{
|
|
|
+ LuckyBoxCfg luckyBoxCfg = LuckyBoxCfgArray.Instance.GetCfg(LuckyBoxDataManager.Instance.currentBoxId);
|
|
|
+ int boughtCount = GameGlobal.myNumericComponent.GetAsInt(luckyBoxCfg.numericType);
|
|
|
+ if (boughtCount + LuckyBoxDataManager.ONCE_TIME > luckyBoxCfg.maxCount)
|
|
|
+ {
|
|
|
+ PromptController.Instance.ShowFloatTextPrompt("抽奖次数不足");
|
|
|
+ return;
|
|
|
+ }
|
|
|
LuckyBoxDataManager.Instance.CheckItemEnough(LuckyBoxDataManager.Instance.currentBoxId, LuckyBoxDataManager.ONCE_TIME, async () =>
|
|
|
{
|
|
|
bool result = await LuckyBoxSProxy.ReqGetBonus(LuckyBoxDataManager.Instance.currentBoxId, LuckyBoxDataManager.ONCE_TIME);
|
|
@@ -234,6 +244,13 @@ namespace GFGGame
|
|
|
|
|
|
private void OnClickBtnBuyTen()
|
|
|
{
|
|
|
+ LuckyBoxCfg luckyBoxCfg = LuckyBoxCfgArray.Instance.GetCfg(LuckyBoxDataManager.Instance.currentBoxId);
|
|
|
+ int boughtCount = GameGlobal.myNumericComponent.GetAsInt(luckyBoxCfg.numericType);
|
|
|
+ if (boughtCount + LuckyBoxDataManager.TEN_TIME > luckyBoxCfg.maxCount)
|
|
|
+ {
|
|
|
+ PromptController.Instance.ShowFloatTextPrompt("抽奖次数不足");
|
|
|
+ return;
|
|
|
+ }
|
|
|
LuckyBoxDataManager.Instance.CheckItemEnough(LuckyBoxDataManager.Instance.currentBoxId, LuckyBoxDataManager.TEN_TIME, async () =>
|
|
|
{
|
|
|
bool result = await LuckyBoxSProxy.ReqGetBonus(LuckyBoxDataManager.Instance.currentBoxId, LuckyBoxDataManager.TEN_TIME);
|