42 lines
1.2 KiB
C#
42 lines
1.2 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using GCGame.Table;
|
|
|
|
public class BanQuetRewItem : UIItemBase {
|
|
|
|
public Image _ItemQuality;
|
|
public Image _ItemIcon;
|
|
|
|
private int itemDataId = -1;
|
|
public override void Show(Hashtable hash)
|
|
{
|
|
base.Show(hash);
|
|
|
|
itemDataId = (int)hash["InitObj"];
|
|
var commonItem = TableManager.GetCommonItemByID(itemDataId, 0);
|
|
if(commonItem == null)
|
|
{
|
|
return;
|
|
}
|
|
|
|
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);
|
|
}
|
|
}
|
|
|
|
public override void OnItemClick()
|
|
{
|
|
base.OnItemClick();
|
|
ItemTooltipsLogic.ShowItemTooltip(itemDataId, ItemTooltipsLogic.ShowType.Info, this.gameObject.transform.position);
|
|
}
|
|
}
|