51 lines
1.5 KiB
C#
51 lines
1.5 KiB
C#
|
using UnityEngine;
|
|||
|
using System.Collections;
|
|||
|
using UnityEngine.UI;
|
|||
|
using GCGame.Table;
|
|||
|
using Module.Log;
|
|||
|
using GCGame;
|
|||
|
|
|||
|
public class WelfareLevelRewardItem : UIItemBase {
|
|||
|
|
|||
|
public Image _ItemQuality;
|
|||
|
public Image _ItemIcon;
|
|||
|
public Text _ItemCount;
|
|||
|
|
|||
|
private int _ItemId;
|
|||
|
public override void Show(Hashtable hash)
|
|||
|
{
|
|||
|
base.Show(hash);
|
|||
|
WelfareRew info = (WelfareRew)hash["InitObj"];
|
|||
|
if(info == null)
|
|||
|
{
|
|||
|
LogModule.ErrorLog("info is null");
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
Tab_CommonItem commonItem = TableManager.GetCommonItemByID(info._ItemId, 0);
|
|||
|
if(commonItem == null)
|
|||
|
{
|
|||
|
LogModule.ErrorLog("commonItem is null");
|
|||
|
return;
|
|||
|
}
|
|||
|
_ItemId = info._ItemId;
|
|||
|
LoadAssetBundle.Instance.SetImageSprite(_ItemQuality, GCGame.Utils.GetItemQualityFrame(commonItem.Quality));
|
|||
|
LoadAssetBundle.Instance.SetImageSprite(_ItemIcon, commonItem.Icon);
|
|||
|
if (commonItem.QualityEffect > 0)
|
|||
|
{
|
|||
|
CommonItemContainerItem.ShowQualityEffect(true, commonItem.QualityEffect, _ItemIcon.transform);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
CommonItemContainerItem.ShowQualityEffect(false, commonItem.QualityEffect, _ItemIcon.transform);
|
|||
|
}
|
|||
|
|
|||
|
_ItemCount.text = Utils.ConvertLargeNumToPretty(info._ItemNum);
|
|||
|
}
|
|||
|
|
|||
|
public override void OnItemClick()
|
|||
|
{
|
|||
|
ItemTooltipsLogic.ShowItemTooltip(_ItemId, ItemTooltipsLogic.ShowType.Info, _ItemIcon.transform.position);
|
|||
|
}
|
|||
|
}
|