// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖 

using System.Linq;
using UnityEngine;
using FairyGUI;
using Fantasy;
using NBC;
using NBF.Utils;

namespace NBF
{
    public partial class ShopGearItem : GButton
    {
        public ShopItemInfo Info;

        private void OnInited()
        {
        }

        public virtual void SetData(ShopItemInfo shopItemInfo)
        {
            Info = shopItemInfo;
            var award = shopItemInfo.Config; //goodsConfig.Awards.First();
            title = award.Id.GetName();
            this.SetIcon(award.Id);

            var cfg = Game.Tables.TbItem.Get(award.Id);

            // Quality.SetQuality(cfg.Quality);
            // QualityCtrl.selectedIndex = cfg.Quality;
            this.SetTitleQuality(cfg.Quality);

            // TextAmount.text = $"个数：{1}";
            // TextPrice.text = shopItemInfo.Price1.ToString();
        }
    }
}