38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
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 = "";
|
|
//labels[2].text = MyText.Get_ItemName(id);
|
|
}
|
|
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));
|
|
}
|
|
}
|
|
} |