private CEquipTrans GetEquipTrans(Shop_MysticShop data, int gold, int diamond)
    {
        CEquipTrans trans = new CEquipTrans {
            m_nTransID    = LocalSave.Instance.SaveExtra.GetTransID(),
            m_nType       = 1,
            m_nCoins      = (ushort)gold,
            m_nDiamonds   = (ushort)diamond,
            m_stEquipItem = new CEquipmentItem()
        };

        trans.m_stEquipItem.m_nUniqueID = Utils.GenerateUUID();
        trans.m_stEquipItem.m_nEquipID  = (uint)data.ProductId;
        trans.m_stEquipItem.m_nLevel    = 1;
        trans.m_stEquipItem.m_nFragment = (uint)data.ProductNum;
        return(trans);
    }
            public void Add(Shop_MysticShop data)
            {
                Dictionary <int, WeightRandom> dictionary = null;
                WeightRandom random = null;
                int          index  = 0;
                int          length = data.Position.Length;

                while (index < length)
                {
                    if (!this.mList.TryGetValue(data.Position[index], out dictionary))
                    {
                        dictionary = new Dictionary <int, WeightRandom>();
                        this.mList.Add(data.Position[index], dictionary);
                    }
                    if (!dictionary.TryGetValue(data.ShopType, out random))
                    {
                        random = new WeightRandom();
                        dictionary.Add(data.ShopType, random);
                    }
                    random.Add(data.ID, data.Weights);
                    index++;
                }
            }
Ejemplo n.º 3
0
    public void Init(int index, Shop_MysticShop data)
    {
        if (this.mItem == null)
        {
            this.mItem = CInstance <UIResourceCreator> .Instance.GetPropOneEquip(this.equipparent.transform);

            this.mItem.SetButtonEnable(false);
        }
        Drop_DropModel.DropData data2 = new Drop_DropModel.DropData {
            type  = PropType.eEquip,
            id    = data.ProductId,
            count = data.ProductNum
        };
        this.mEquipOne.Clear();
        this.mEquipOne.EquipID = data.ProductId;
        this.mItem.InitProp(data2);
        this.mIndex    = index;
        this.bBuy      = false;
        this.mData     = data;
        this.equipdata = LocalModelManager.Instance.Equip_equip.GetBeanById(this.mData.ProductId);
        if (this.equipdata == null)
        {
            object[] args = new object[] { data.ID };
            SdkManager.Bugly_Report("BlackItemOneCtrl", Utils.FormatString("Init Equip_equip:{0} is null", args));
        }
        else
        {
            this.SetBuy(this.bBuy);
            this.mGoldCtrl.UseTextRed();
            this.mGoldCtrl.SetCurrencyType(data.PriceType);
            this.mGoldCtrl.SetValue(data.Price);
            this.Text_Sold.text = GameLogic.Hold.Language.GetLanguageByTID("blackshop_sold", Array.Empty <object>());
            this.Image_Buy.transform.localScale = Vector3.one;
            this.Text_Name.text = this.mEquipOne.NameOnlyString;
            this.Text_Name.set_color(this.mEquipOne.qualityColor);
        }
    }