using UnityEngine;
|
using UnityEngine.UI;
|
using System.Collections.Generic;
|
using System;
|
|
public class ItemCell : CommonItemBaisc
|
{
|
private Button m_Reducebtn;
|
public Button reducebtn {
|
get {
|
if (m_Reducebtn == null)
|
{
|
LoadPrefab();
|
m_Reducebtn = this.transform.GetComponent<Button>("Container_ItemCell/Btn_Reduce");
|
}
|
return m_Reducebtn;
|
}
|
}
|
|
Image m_AuctionIcon;
|
public Image auctionIcon
|
{
|
get
|
{
|
if (m_AuctionIcon == null)
|
{
|
LoadPrefab();
|
m_AuctionIcon = this.transform.GetComponent<Image>("Container_ItemCell/Img_Auction");
|
}
|
return m_AuctionIcon;
|
}
|
}
|
|
Image m_TimeMark;
|
public Image timeMark
|
{
|
get
|
{
|
if (m_TimeMark == null)
|
{
|
LoadPrefab();
|
m_TimeMark = this.transform.GetComponent<Image>("Container_ItemCell/Img_Time");
|
}
|
return m_TimeMark;
|
}
|
}
|
|
public override void Init(ItemModel model, bool isCompare = false)
|
{
|
base.Init(model, isCompare);
|
reducebtn.SetActive(false);
|
auctionIcon.SetActive(false);
|
// auctionIcon.SetActive(model.isAuction);
|
// if (model.isAuction)
|
// {
|
// auctionIcon.SetSprite(ItemLogicUtility.Instance.IsOverdue(model.guid) ? "Item_Auction_3" : "Item_Auction_1");
|
// }
|
|
timeMark?.SetActive(model.config.Type == 145 && model.config.CDTime > 0);
|
}
|
|
public override void Init(ItemCellModel model)
|
{
|
base.Init(model);
|
reducebtn.SetActive(false);
|
auctionIcon.SetActive(false);
|
|
timeMark?.SetActive(model.itemConfig.Type == 145 && model.itemConfig.CDTime > 0);
|
}
|
}
|