using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;

public class prfb_hor_item : MonoBehaviour
{
    bool isSelect = false;
    NetLableItem data = null;
    // Start is called before the first frame update
    void Start()
    {   
    }

    // Update is called once per frame
    void Update()
    {
    }
    public void onClick()
    {
        if(isSelect == false)
        {
            utilsTools.sendEventObjectParams("switchHomeLabels", data.id);
            //setData(data, true);
        }
    }
    public void setData(NetLableItem netLableItem,bool isSelect)
    {
        data = netLableItem;
        this.isSelect = isSelect;
        var image = transform.Find("bg").GetComponent<Image>();
        Color color = image.color;
        color.a = isSelect ? 1 : 0;
        image.color = color;
        var tv = transform.Find("tv").GetComponent<Text>();
        tv.text = netLableItem.name();
        tv.color = isSelect ? Color.white : Color.black;
    }
}
