|
@@ -47,7 +47,7 @@ namespace GFGGame
|
|
protected override void AddEventListener()
|
|
protected override void AddEventListener()
|
|
{
|
|
{
|
|
base.AddEventListener();
|
|
base.AddEventListener();
|
|
- EventAgent.AddEventListener(ConstMessage.NUMERIC_CHANGE, UpdateView);
|
|
|
|
|
|
+ EventAgent.AddEventListener(ConstMessage.SHOP_BUY, UpdateView);
|
|
|
|
|
|
}
|
|
}
|
|
protected override void OnShown()
|
|
protected override void OnShown()
|
|
@@ -67,7 +67,7 @@ namespace GFGGame
|
|
protected override void RemoveEventListener()
|
|
protected override void RemoveEventListener()
|
|
{
|
|
{
|
|
base.RemoveEventListener();
|
|
base.RemoveEventListener();
|
|
- EventAgent.RemoveEventListener(ConstMessage.NUMERIC_CHANGE, UpdateView);
|
|
|
|
|
|
+ EventAgent.RemoveEventListener(ConstMessage.SHOP_BUY, UpdateView);
|
|
}
|
|
}
|
|
private void OnBtnBlackRewardClick()
|
|
private void OnBtnBlackRewardClick()
|
|
{
|
|
{
|
|
@@ -173,15 +173,19 @@ namespace GFGGame
|
|
ShopViewManager.Instance.UptadeItem(obj, shopCfg);
|
|
ShopViewManager.Instance.UptadeItem(obj, shopCfg);
|
|
}
|
|
}
|
|
|
|
|
|
- private void OnClickBtnBuy(EventContext context)
|
|
|
|
|
|
+ private async void OnClickBtnBuy(EventContext context)
|
|
{
|
|
{
|
|
GObject obj = context.sender as GObject;
|
|
GObject obj = context.sender as GObject;
|
|
int index = (int)obj.data;
|
|
int index = (int)obj.data;
|
|
ShopCfg itemData = _shopCfgs[index];
|
|
ShopCfg itemData = _shopCfgs[index];
|
|
if (!AntiAddictionController.CheckAntiAddictionRecharge(itemData.price))
|
|
if (!AntiAddictionController.CheckAntiAddictionRecharge(itemData.price))
|
|
{
|
|
{
|
|
- ShopSProxy.ReqShopBuy(itemData.id, 1).Coroutine();
|
|
|
|
- LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.SHANG_CHENG, 2);
|
|
|
|
|
|
+ bool result = await ShopSProxy.ReqShopBuy(itemData.id, 1);
|
|
|
|
+ if (result)
|
|
|
|
+ {
|
|
|
|
+ UpdateView();
|
|
|
|
+ LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.SHANG_CHENG, 2);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|