public void BuyShopItem(int resId) { PlayerDataModule pdm = ModuleManager.Instance.FindModule <PlayerDataModule>(); if (pdm == null) { return; } pdm.SetShopIsBuyDone(resId, true); ShopUIEvent ev = new ShopUIEvent(ShopUIEvent.SHOP_BUY_ITEM); ev.resId = resId; EventSystem.Instance.PushEvent(ev); }
void onMallBuy(EventBase ev) { ShopUIEvent e = ev as ShopUIEvent; if (e == null) { return; } int resId = e.resId; if (!DataManager.ShopTable.ContainsKey(resId)) { GameDebug.LogError("不存在的商店表id"); return; } ShopTableItem item = DataManager.ShopTable[resId] as ShopTableItem; string content = StringHelper.GetString("egg_get_item") + ItemManager.getItemNameWithColor(item.itemId) + " X "; uint count = 0; if (mSecretItems.ContainsKey(resId)) { PlayerDataModule pdm = ModuleManager.Instance.FindModule <PlayerDataModule>(); ShopItemInfo info = pdm.GetShopSecretItemInfo(resId); if (info == null) { return; } count = (uint)info.count * item.multiple; } else { count = item.minCount * item.multiple; } PopTipManager.Instance.AddNewTip(content + count); updateMallUI(resId, false); }
public void RefreshShop() { ShopUIEvent ev = new ShopUIEvent(ShopUIEvent.SHOP_REFRESH_ITEM); EventSystem.Instance.PushEvent(ev); }