Exemplo n.º 1
0
            private void OnItemToggleClicked()
            {
                UIToggle toggle = UIToggle.current;

                if (toggle.value == false)
                {
                    return;
                }

                OperationRedeemCommodity commodity = (OperationRedeemCommodity)toggle.Param;

                mCurrentCommodity = commodity;

                if (commodity == null)
                {
                    return;
                }

                mCommodityNameLabel.text        = GoodsHelper.GetGoodsOriginalNameByTypeId(commodity.IconGoodsId);
                mCommodityDescriptLabel.text    = GoodsHelper.GetGoodsDescriptionByTypeId(commodity.IconGoodsId);
                mCostMoneyTypeSprite.spriteName = UIWidgetHelp.GetMoneySpriteName(commodity.PriceType);
                mBuyNumberInput.value           = "1";

                UpdateCostMoneyLabel();
            }
Exemplo n.º 2
0
        public void UpdateSoul()
        {
            if (BasicAttrs == null)
            {
                BasicAttrs = new ActorAttribute();
            }
            BasicAttrs.Clear();


            CurLvHaveVal = 0;
            if (Lv >= 2)
            {
                for (int i = 1; i < Lv; i++)
                {
                    string csv_id = string.Format("{0}_{1}", type_idx, i);
                    var    info   = DBSoulLv.Instance.GetData(csv_id);
                    if (info != null)
                    {
                        CurLvHaveVal += info.cream;
                    }
                }
            }



            string key = string.Format("{0}_{1}", type_idx, Lv);

            SetAttribute(key, BasicAttrs, true);



            if (MaxBasicAttrs == null)
            {
                MaxBasicAttrs = new ActorAttribute();
            }
            MaxBasicAttrs.Clear();
            var data_soul_list = DBManager.Instance.QuerySqliteLikeKeyRow <string>(GlobalConfig.DBFile, "data_soul", "gid", type_idx.ToString());

            if (data_soul_list.Count <= 0)
            {
                GameDebug.LogError("不存在该武魂id" + type_idx.ToString());
                return;
            }

            var data_soul = data_soul_list[0];

            MaxLv = DBTextResource.ParseUI(data_soul["max_lv"]);
            Tips  = data_soul["tips"];


            mSoulType = DBTextResource.ParseUI(data_soul["type"]);

            if (data_soul["s_type"].Contains("["))
            {
                mTypeList = DBTextResource.ParseArrayUint(data_soul["s_type"], ",");
            }
            else
            {
                mTypeList = new List <uint>();
                uint value = DBTextResource.ParseUI(data_soul["s_type"]);
                mTypeList.Add(value);
            }


            key = string.Format("{0}_{1}", type_idx, MaxLv);
            SetAttribute(key, MaxBasicAttrs, false);


            IsMaxLv = MaxLv == Lv;


            string oriDes = GoodsHelper.GetGoodsDescriptionByTypeId(type_idx);

            if (isShowAttr)
            {
                base.description = GetShowDetailText();
            }
            else
            {
                base.description = oriDes;
            }
        }