public void OnClickConfirm() { C2G.ItemSale packet = new C2G.ItemSale(); packet.item_idn = m_ItemInfo.Info.IDN; packet.item_count = m_ChosenCount; Network.GameServer.JsonAsync <C2G.ItemSale, C2G.ItemSaleAck>(packet, OnItemSaleHandler); }
public void OnItemSaleHandler(C2G.ItemSale send, C2G.ItemSaleAck recv) { Tooltip.Instance.ShowMessageKey("SuccessSale"); m_ItemInfo.UseItem(send.item_count); Network.PlayerInfo.AddGoods(recv.add_gold); GameMain.Instance.UpdatePlayerInfo(); OnClose(); }
public void OnSaleHandler(C2G.ItemSale packet, C2G.ItemSaleAck ack) { Network.PlayerInfo.AddGoods(ack.add_gold); m_Item.UseItem(SelectedCount); GameMain.Instance.UpdatePlayerInfo(); GameMain.Instance.UpdateMenu(); if (OnItemSale != null) { OnItemSale(); } }
public void OnClickSale() { if (SelectedCount <= 0 || SelectedCount > m_Item.Count) { Popup.Instance.ShowMessageKey("NotEnoughStuff"); return; } C2G.ItemSale packet = new C2G.ItemSale(); packet.item_idn = m_Item.Info.IDN; packet.item_count = SelectedCount; Network.GameServer.JsonAsync <C2G.ItemSale, C2G.ItemSaleAck>(packet, OnSaleHandler); }