44 lines
1.3 KiB
C#
44 lines
1.3 KiB
C#
|
using UnityEngine;
|
|||
|
using System.Collections;
|
|||
|
using UnityEngine.UI;
|
|||
|
using System;
|
|||
|
using GCGame.Table;
|
|||
|
|
|||
|
public class AucationRecordItem : MonoBehaviour {
|
|||
|
|
|||
|
public Sprite[] BG;
|
|||
|
public Image mBG;
|
|||
|
public Text time;
|
|||
|
public Text itemName;
|
|||
|
public Text userName;
|
|||
|
public Text userCostMoney;
|
|||
|
public Image moneyIcon;
|
|||
|
|
|||
|
public void InitItem(int endTime, int snatchId, string winerName, int putintoCount, int index)
|
|||
|
{
|
|||
|
mBG.overrideSprite = BG[index % 2];
|
|||
|
|
|||
|
DateTime end = GCGame.Utils.GetServerDateTime(endTime);
|
|||
|
time.text = end.Year + "-" + end.Month + "-" + end.Day;
|
|||
|
|
|||
|
Tab_SnatchTreasure snatchTab = TableManager.GetSnatchTreasureByID(snatchId, 0);
|
|||
|
if (snatchTab == null)
|
|||
|
{
|
|||
|
return;
|
|||
|
}
|
|||
|
Tab_CommonItem commonItem = TableManager.GetCommonItemByID(snatchTab.ItemId, 0);
|
|||
|
if (commonItem == null)
|
|||
|
{
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
itemName.text = commonItem.Name + "X" + snatchTab.ItemNum;
|
|||
|
userName.text = winerName;
|
|||
|
//设置金钱类型
|
|||
|
LoadAssetBundle.Instance.SetImageSprite(moneyIcon, UICurrencyItem.GetCurrencySprite((MONEYTYPE)snatchTab.BetMoneyType));
|
|||
|
moneyIcon.SetNativeSize();
|
|||
|
userCostMoney.text = (putintoCount * snatchTab.MoneyNumPerBet).ToString();
|
|||
|
}
|
|||
|
|
|||
|
}
|