public BlackItemOnectrl GetBlackShopOne(Transform parent = null) { BlackItemOnectrl onectrl = this.Get <BlackItemOnectrl>("UIPanel/CharUI/BlackItemOne"); if (parent != null) { onectrl.transform.SetParentNormal(parent); } return(onectrl); }
private void InitUI() { this.buys.Clear(); this.shoptype = LocalModelManager.Instance.Shop_MysticShop.GetRandomShopType(); this.mDataList = LocalModelManager.Instance.Shop_MysticShop.GetListByStage(GameLogic.Hold.BattleData.Level_CurrentStage, this.shoptype); this.mList.Clear(); int count = this.mDataList.Count; float num3 = (-(MathDxx.Clamp(count, 0, 4) - 1) * 200f) / 2f; for (int i = 0; i < count; i++) { BlackItemOnectrl item = this.mPool.DeQueue <BlackItemOnectrl>(); item.Init(i, this.mDataList[i]); item.OnClickButton = new Action <BlackItemOnectrl>(this.OnClickBuy); RectTransform child = item.transform as RectTransform; child.SetParentNormal(this.items); child.anchoredPosition = new Vector2(num3 + ((i % 4) * 200f), 120f + ((i / 4) * -240f)); this.mList.Add(item); } this.shows.Clear(); int num5 = 0; int num6 = this.mDataList.Count; while (num5 < num6) { this.shows.Add(this.mDataList[num5].ProductId); num5++; } for (int j = this.shows.Count; j < 8; j++) { this.shows.Add(0); } if (this.shows.Count >= 8) { SdkManager.send_event_mysteries("SHOW", this.shoptype, 0, 0, this.shows[0], this.shows[1], this.shows[2], this.shows[3], this.shows[4], this.shows[5], this.shows[6], this.shows[7], 0, 0, string.Empty, string.Empty); } }
private void OnClickBuy(BlackItemOnectrl one) { int coins = (one.mData.PriceType != 1) ? 0 : one.mData.Price; int gems = (one.mData.PriceType != 2) ? 0 : one.mData.Price; SdkManager.send_event_mysteries("CLICK", this.shoptype, one.mIndex, one.mData.ProductId, 0, 0, 0, 0, 0, 0, 0, 0, coins, gems, string.Empty, string.Empty); LocalSave.EquipOne one2 = new LocalSave.EquipOne { EquipID = one.mData.ProductId, bNew = false, Count = one.mData.ProductNum, Level = 1, WearIndex = -1 }; EquipInfoModuleProxy.Transfer data = new EquipInfoModuleProxy.Transfer { one = one2, type = EquipInfoModuleProxy.InfoType.eBuy, buy_itemone = one, buy_callback = new Action <BlackItemOnectrl>(this.OnClickBuyInternal) }; EquipInfoModuleProxy proxy = new EquipInfoModuleProxy(data); Facade.Instance.RegisterProxy(proxy); WindowUI.ShowWindow(WindowID.WindowID_EquipInfo); }
private void OnClickBuyInternal(BlackItemOnectrl one) {