92 lines
2.8 KiB
C#
92 lines
2.8 KiB
C#
|
using UnityEngine;
|
|||
|
using System.Collections;
|
|||
|
using UnityEngine.UI;
|
|||
|
using GCGame.Table;
|
|||
|
|
|||
|
public class AucationResultItem : MonoBehaviour {
|
|||
|
|
|||
|
#region
|
|||
|
public Image _ItemQuality;
|
|||
|
public Image itemIcon;
|
|||
|
public Image markBG;
|
|||
|
public Text itemName;
|
|||
|
public Text hadPutIntoCount;
|
|||
|
public Text resultDesc;
|
|||
|
#endregion
|
|||
|
|
|||
|
public int snatchId = -1;
|
|||
|
public int curIndex = -1;
|
|||
|
public int curGroup = -1;
|
|||
|
public void InitItem(AucationResultItemInfo info, int index)
|
|||
|
{
|
|||
|
curIndex = index;
|
|||
|
snatchId = info.snatchId;
|
|||
|
curGroup = info.curGoingGroup;
|
|||
|
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(itemIcon, commonItem.Icon); //itemIcon
|
|||
|
LoadAssetBundle.Instance.SetImageSprite(_ItemQuality, GCGame.Utils.GetItemQualityFrame(commonItem.Quality));
|
|||
|
if (commonItem.QualityEffect > 0)
|
|||
|
{
|
|||
|
CommonItemContainerItem.ShowQualityEffect(true, commonItem.QualityEffect, itemIcon.transform);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
CommonItemContainerItem.ShowQualityEffect(false, commonItem.QualityEffect, itemIcon.transform);
|
|||
|
}
|
|||
|
|
|||
|
hadPutIntoCount.text = StrDictionary.GetClientDictionaryString("#{47024}", info.selfHadPutIntoCount);//"已投入" + info.selfHadPutIntoCount + "份";
|
|||
|
if(info.state == 1)
|
|||
|
{
|
|||
|
resultDesc.text = StrDictionary.GetClientDictionaryString("#{47025}");//"等待开奖";//进行中
|
|||
|
}else
|
|||
|
{
|
|||
|
if(info.winerName.Equals(GameManager.gameManager.PlayerDataPool.MainPlayerBaseAttr.RoleName))
|
|||
|
{
|
|||
|
resultDesc.text = StrDictionary.GetClientDictionaryString("#{47026}");//"夺宝成功";//获奖
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
resultDesc.text = StrDictionary.GetClientDictionaryString("#{47027}");//"夺宝失败";//未获奖
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public void OnItemClick()
|
|||
|
{
|
|||
|
if (SelfAucationResultInfoPanel.Instance)
|
|||
|
{
|
|||
|
SelfAucationResultInfoPanel.Instance.OnResultItemClick(snatchId, curIndex, curGroup);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//设置当前按钮的背景遮罩
|
|||
|
public void InitItemState(bool isOn)
|
|||
|
{
|
|||
|
if(isOn)
|
|||
|
{
|
|||
|
if(!markBG.isActiveAndEnabled)
|
|||
|
{
|
|||
|
markBG.gameObject.SetActive(true);
|
|||
|
}
|
|||
|
}else
|
|||
|
{
|
|||
|
if(markBG.isActiveAndEnabled)
|
|||
|
{
|
|||
|
markBG.gameObject.SetActive(false);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|