using Excel2Json;
using UnityEngine;
using UnityEngine.UI;

namespace Mono
{
    [UIBinding(prefab = "PoetryItem")]
    public class PoetryItem : UICom
    {
        public Button Btn_PoetryItem;

        public Text Text_PoetryName;

        public RectTransform PoetryItemRoot;


        public override void GetUIData()
        {
            Btn_PoetryItem = UIData.Get<Button>("Btn_PoetryItem");
            Text_PoetryName = UIData.Get<Text>("Text_PoetryName");
        }

        public override void AddButtonEvent()
        {
            Btn_PoetryItem.onClick.AddListener(() => { Debug.Log("点击了古诗" + Text_PoetryName); });
        }

        public PoetConfig PoetConfig;

        public void CustomInit(PoetConfig poetConfig)
        {
            PoetConfig = poetConfig;
            Text_PoetryName.text = "《"+PoetConfig.name+"》";
        }
    }
}