49 lines
1004 B
C#
49 lines
1004 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class MoneyForm : MonoBehaviour
|
|
{
|
|
public Image icon;
|
|
public TextMeshProUGUI amount;
|
|
|
|
int m_itemid;
|
|
|
|
public void Set(int id)
|
|
{
|
|
if (id > 0)
|
|
{
|
|
gameObject.SetActive(true);
|
|
m_itemid = id;
|
|
Refresh();
|
|
}
|
|
else
|
|
gameObject.SetActive(false);
|
|
}
|
|
|
|
public void Refresh()
|
|
{
|
|
if (m_itemid > 0)
|
|
{
|
|
icon.sprite = UIAtlasMgr.Ins.Get_Sprite(m_itemid);
|
|
amount.text = NumberFormatter.FormatNumber(ServerInfo.Ins.m_ServerData.Get_ItemAmount(m_itemid));
|
|
}
|
|
}
|
|
|
|
public void OnClick_Money()
|
|
{
|
|
|
|
}
|
|
|
|
public void Set(int id, int count)
|
|
{
|
|
icon.sprite = UIAtlasMgr.Ins.Get_Sprite(id);
|
|
Set_Amount(count);
|
|
}
|
|
public void Set_Amount(int count)
|
|
{
|
|
amount.text = NumberFormatter.FormatNumber(count);
|
|
}
|
|
} |