Пример #1
0
 protected void SetGoods(UGD_GoodsDispositionItem _itemData)
 {
     for (int i = 0; i < _itemData.GoodsList.Length; ++i)
     {
         if (i < 6)
         {
             EerlyGoodsImgList[i].sprite = UGoodsDispositionView.GetGoodsIconByGoodsID(_itemData.GoodsList[i]);
         }
         else
         {
             CoreGoodsImgList[i - 6].sprite = UGoodsDispositionView.GetGoodsIconByGoodsID(_itemData.GoodsList[i]);
         }
     }
 }
Пример #2
0
        public virtual void SetData(int _newMobaGoodsID)
        {
            if (_newMobaGoodsID == m_nMobaGoodsID)
            {
                return;
            }

            m_nMobaGoodsID    = _newMobaGoodsID;
            GoodsImage.sprite = UGoodsDispositionView.GetGoodsIconByGoodsID(m_nMobaGoodsID);

            if (ShowTooltip)
            {
                if (GoodsTooltips == null)
                {
                    GoodsTooltips = gameObject.AddComponent <UTooltipTrigger>(ETooltipStyle.ETS_WarGoods);
                }

                SSchemeMobaGoods goodsSScheme;
                GoodsSchemesDataManager.Instance.GetMobaGoods_Out(_newMobaGoodsID, out goodsSScheme);
                if (goodsSScheme != null && _newMobaGoodsID != 0 && GoodsTooltips != null)
                {
                    GoodsTooltips.enabled = true;
                    GoodsTooltips.SetImage(GoodsTooltip_IconParamName, UGoodsDispositionView.GetGoodsIcon(goodsSScheme.GoodsIconID));
                    GoodsTooltips.SetText(GoodsTooltip_NameParamName, goodsSScheme.GoodsName);
                    string GoodsDes = goodsSScheme.GoodsDes;
                    UBBProperty.GetInstance().getRatio(GoodsDes);
                    U3D_Render.Common.UBB.toHtml(ref GoodsDes, UBB_FORMAT_TYPE.UGUI);
                    GoodsTooltips.SetText(GoodsTooltip_InfoParamName, GoodsDes);
                    GoodsTooltips.SetText(GoodsTooltip_CostParamName, goodsSScheme.GoodsCost.ToString());
                }
                else
                {
                    GoodsTooltips.enabled = false;
                }
            }
        }