Project_WL/Assets/Script/UI/Kettle/KettleExchangeCard.cs

38 lines
1.1 KiB
C#
Raw Normal View History

2024-12-15 01:39:39 +00:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class KettleExchangeCard : MonoBehaviour
{
public UISprite[] sprites; // 0 아이콘
public UILabel[] labels; // 0 가지고 있는 개수, 1 변경되는 개수, 2 이름
int m_ID;
public void Set(int id)
{
m_ID = id;
if (m_ID > 0)
{
sprites[0].spriteName = DSUtil.Get_ItemSpriteInfo(eItem.Food, m_ID).Icon;
labels[0].text = DSUtil.GetThousandCommaText(ServerInfo.Ins.m_ServerData.Get_ItemAmount(eItem.Food, id));
labels[1].text = "";
2024-12-22 01:07:25 +00:00
//labels[2].text = MyText.Get_ItemName(id);
2024-12-15 01:39:39 +00:00
}
else
{
sprites[0].spriteName = DSUtil.Get_ItemSpriteInfo(eItem.IdontKnow, m_ID).Icon;
labels[0].text = labels[1].text = labels[2].text = "";
}
}
public void Set_Amount(Color color, int amount)
{
if (m_ID > 0)
{
labels[1].color = color;
labels[1].text = DSUtil.Format("{0}{1}", Mathf.Approximately(color.r, 0f) ? "-" : "+", DSUtil.GetThousandCommaText(amount));
}
}
}