44 lines
1.4 KiB
C#
44 lines
1.4 KiB
C#
|
using UnityEngine;
|
|||
|
using System.Collections;
|
|||
|
using UnityEngine.UI;
|
|||
|
using System;
|
|||
|
using GCGame.Table;
|
|||
|
|
|||
|
public class AucationSelfRecordItem : MonoBehaviour {
|
|||
|
|
|||
|
public Sprite[] BG; //循环交替背景
|
|||
|
public Image mBG;
|
|||
|
public Text time;
|
|||
|
public Text itemName;
|
|||
|
public Image moneyIcon;
|
|||
|
public Text costMoney;
|
|||
|
|
|||
|
public void InitItem(int endTime, int snatchId, int putintoCount, int index)
|
|||
|
{
|
|||
|
mBG.overrideSprite = BG[index % 2];
|
|||
|
|
|||
|
var _EndTime = GCGame.Utils.GetServerDateTime(endTime);
|
|||
|
//System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); // 当地时区
|
|||
|
//DateTime end = GCGame.Utils.GetServerDateTime().AddSeconds(endTime);
|
|||
|
time.text = _EndTime.Year + "-" + _EndTime.Month + "-" + _EndTime.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;
|
|||
|
|
|||
|
//设置金钱类型
|
|||
|
LoadAssetBundle.Instance.SetImageSprite(moneyIcon, UICurrencyItem.GetCurrencySprite((MONEYTYPE)snatchTab.BetMoneyType));
|
|||
|
costMoney.text = (putintoCount * snatchTab.MoneyNumPerBet).ToString();
|
|||
|
}
|
|||
|
|
|||
|
}
|