浮漂脚本
This commit is contained in:
35
Assets/Scripts/UI/Shops/ShopGearItem.cs
Normal file
35
Assets/Scripts/UI/Shops/ShopGearItem.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
// 本脚本只在不存在时会生成一次。组件逻辑写在当前脚本内。已存在不会再次生成覆盖
|
||||
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using FairyGUI;
|
||||
using Fantasy;
|
||||
using NBC;
|
||||
using NBF.Utils;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public partial class ShopGearItem : GButton
|
||||
{
|
||||
public GoodsConfig Config;
|
||||
private void OnInited()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void SetData(GoodsConfig goodsConfig)
|
||||
{
|
||||
Config = goodsConfig;
|
||||
var award = goodsConfig.Awards.First();
|
||||
title = award.Id.GetName();
|
||||
this.SetIcon(award.Id);
|
||||
|
||||
var cfg = ItemConfig.Get(award.Id);
|
||||
|
||||
Quality.SetQuality(cfg.Quality);
|
||||
this.SetTitleQuality(cfg.Quality);
|
||||
|
||||
TextAmount.text = $"个数:{award.Amount}";
|
||||
TextPrice.text = goodsConfig.Price1.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user