|
@@ -16,6 +16,8 @@ namespace GFGGame
|
|
|
|
|
|
public const float ANIMATION_TIME = 1.2f; //翻牌获得物品展示时间
|
|
|
|
|
|
+ public bool CHECK_TIPS_OPEN = false; //提示弹窗是否打开
|
|
|
+
|
|
|
private List<ItemData> _rewardsList;//当前奖励,每次抽奖后刷新
|
|
|
private Dictionary<int, ItemData> _firstRewardsList = new Dictionary<int, ItemData>();//首次获得的奖励
|
|
|
private Dictionary<int, List<LuckyBoxBonusData>> _dicShowList = new Dictionary<int, List<LuckyBoxBonusData>>();
|
|
@@ -242,7 +244,10 @@ namespace GFGGame
|
|
|
}
|
|
|
else if (hasNum >= costNum)
|
|
|
{
|
|
|
- AlertUI.Show(string.Format("是否花费{0}个{1}摘星{2}次?", costNum, itemCfg.name, times)).SetLeftButton(true).SetRightButton(true, "确定", (object data) => { onSuccess(); });
|
|
|
+ if(LuckyBoxDataManager.Instance.CHECK_TIPS_OPEN == false)
|
|
|
+ AlertUI.Show(string.Format("是否花费{0}个{1}摘星{2}次?", costNum, itemCfg.name, times)).SetLeftButton(true).SetRightButton(true, "确定", (object data) => { onSuccess(); });
|
|
|
+ else
|
|
|
+ onSuccess();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -269,9 +274,13 @@ namespace GFGGame
|
|
|
{
|
|
|
ItemUtil.ExchangeItemById(costId, needNum, false, onSuccess);
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- BuyTipsController.Show(costId, needNum, onSuccess);
|
|
|
+ else {
|
|
|
+ if (LuckyBoxDataManager.Instance.CHECK_TIPS_OPEN == false)
|
|
|
+ BuyTipsController.Show(costId, needNum, onSuccess, true);
|
|
|
+ else
|
|
|
+ {
|
|
|
+ OnBuyItem(costId, needNum, onSuccess);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
else//购买消耗品的道具不足,提示购买 购买消耗品的道具
|
|
@@ -281,6 +290,13 @@ namespace GFGGame
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private async void OnBuyItem(int itemId, long count, Action onSuccess = null)
|
|
|
+ {
|
|
|
+ var _result = await ItemExchangeSProxy.ItemExchange(itemId, count);
|
|
|
+ if (_result)
|
|
|
+ BonusController.TryShowBonusList(ItemUtil.CreateItemDataList(itemId, count), onSuccess);
|
|
|
+ }
|
|
|
+
|
|
|
private int GetCostNum(int boxId, int times)
|
|
|
{
|
|
|
LuckyBoxCfg cfg = LuckyBoxCfgArray.Instance.GetCfg(boxId);
|