32 lines
745 B
C#
32 lines
745 B
C#
|
|
using TMPro;
|
||
|
|
using UnityEngine;
|
||
|
|
using UnityEngine.UI;
|
||
|
|
|
||
|
|
public class FarmInvenCard : CardBase
|
||
|
|
{
|
||
|
|
public Image i_fruit;
|
||
|
|
public TextMeshProUGUI t_amount;
|
||
|
|
public GameObject go_select;
|
||
|
|
|
||
|
|
int m_FruitID;
|
||
|
|
|
||
|
|
public override void Set<T>(T _base)
|
||
|
|
{
|
||
|
|
base.Set(_base);
|
||
|
|
Set(int.Parse(_base.ToString()));
|
||
|
|
}
|
||
|
|
public override void Set(int fruitid)
|
||
|
|
{
|
||
|
|
m_FruitID = fruitid;
|
||
|
|
i_fruit.sprite = UIAtlasMgr.Ins.Get_Sprite(fruitid);
|
||
|
|
t_amount.text = ServerInfo.Ins.m_ServerData.Get_ItemAmount(fruitid).ToString();
|
||
|
|
go_select.SetActive(false);
|
||
|
|
}
|
||
|
|
|
||
|
|
public int Get_FruitID() { return m_FruitID; }
|
||
|
|
|
||
|
|
public void OnClick_Select()
|
||
|
|
{
|
||
|
|
FarmInvenUI.Ins.Set_SelectCard(this);
|
||
|
|
}
|
||
|
|
}
|