void PrepareItem(SyncBoughtItem boughtItem) { var ui = Instantiate <ShopItem> (shopItemResource, list.transform); ui.boughtItem = boughtItem; ui.PrepareItem(); }
public void CmdBuy(SyncBoughtItem syncBoughtItem) { var item = items.FirstOrDefault(x => x.GetInstanceID() == syncBoughtItem.id); if (item == null) { return; } Buy(item); RpcBoughtItemCallback(syncBoughtItem); }
void RpcBoughtItemCallback(SyncBoughtItem syncBoughtItem) { var syncItem = syncItems.FirstOrDefault(x => x.id == syncBoughtItem.id); EventManager.TriggerEvent(Constants.EVENT_BOUGHT_ITEM_FROM_SHOP, new { syncItem = syncItem, ownNetId = _race.netId.Value }); }