public void SendPointShopBuy(PointShopItem pointShopItem, PointShop pointShop, int num, Action <bool> call_back) { PointShopBuyModel.SendForm sendForm = new PointShopBuyModel.SendForm(); sendForm.uid = pointShopItem.pointShopItemId; sendForm.num = num; Protocol.Send(PointShopBuyModel.URL, sendForm, delegate(PointShopBuyModel result) { bool obj = false; if (result != null && result.Error == Error.None) { pointShopItem.buyCount += num; pointShop.userPoint -= pointShopItem.needPoint * num; obj = true; } call_back(obj); }, string.Empty); }
private void OnBuy(PointShopItem item, int num) { GameSection.SetEventData(new object[2] { item.name, num }); GameSection.StayEvent(); PointShopBuyModel.SendForm sendForm = new PointShopBuyModel.SendForm(); sendForm.uid = item.pointShopItemId; sendForm.num = num; Protocol.Send(PointShopBuyModel.URL, sendForm, delegate(PointShopBuyModel result) { if (result != null && result.Error == Error.None) { item.buyCount += num; data.userPoint -= item.needPoint * num; RefreshUI(); } GameSection.ResumeEvent(result != null && result.Error == Error.None, null); }, string.Empty); }