45 lines
1.3 KiB
C#
45 lines
1.3 KiB
C#
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using UnityEngine;
|
|||
|
using UnityEngine.UI;
|
|||
|
using GCGame.Table;
|
|||
|
|
|||
|
public class FactionAdvanceRewItem : UIItemBase {
|
|||
|
|
|||
|
public Image _ItemIcon;
|
|||
|
public Image _ItemQuality;
|
|||
|
|
|||
|
private int _ItemDataId;
|
|||
|
public override void Show(Hashtable hash)
|
|||
|
{
|
|||
|
base.Show(hash);
|
|||
|
|
|||
|
_ItemDataId = (int)hash["InitObj"];
|
|||
|
|
|||
|
var commonItem = TableManager.GetCommonItemByID(_ItemDataId, 0);
|
|||
|
if(commonItem == null)
|
|||
|
{
|
|||
|
gameObject.SetActive(false);
|
|||
|
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, _ItemIcon.transform.position);
|
|||
|
}
|
|||
|
}
|