| using UnityEngine;  | 
| using UnityEngine.UI;  | 
|   | 
| namespace vnxbqy.UI  | 
| {  | 
|     public class WishItemCell : MonoBehaviour  | 
|     {  | 
|         [SerializeField] CommonItemBaisc itemBaisc;  | 
|         [SerializeField] GameObject noneItemObj;  | 
|         [SerializeField] Button noneItemBtn;  | 
|         [SerializeField] Text nameText;  | 
|         [SerializeField] Image bestIcon;  | 
|         [SerializeField] GameObject contain_Name;  | 
|   | 
|           | 
|         WishingPoolModel wishingModel { get { return ModelCenter.Instance.GetModel<WishingPoolModel>(); } }  | 
|         public void Display(int index)  | 
|         {  | 
|             WishingPoolModel.WishingWellItem wellItem = null;  | 
|             bool isWishData = wishingModel.TryGetWishDataByIndex(index, out wellItem);  | 
|             noneItemBtn.RemoveAllListeners();  | 
|             if (isWishData)  | 
|             {  | 
|                 contain_Name.SetActive(true);  | 
|                 itemBaisc.SetActive(true);  | 
|                 noneItemObj.SetActive(false);  | 
|                 string rareIconKey = string.Empty;  | 
|                 bool isRare = wishingModel.TryGetItemRareIcon(wellItem.rare, out rareIconKey);  | 
|                 bestIcon.SetActive(isRare);  | 
|                 if (isRare)  | 
|                 {  | 
|                     bestIcon.SetSprite(rareIconKey);  | 
|                 }  | 
|                 ItemConfig itemConfig = ItemConfig.Get(wellItem.itemId);  | 
|                 nameText.text = itemConfig.ItemName;  | 
|                 nameText.color = UIHelper.GetUIColor(itemConfig.ItemColor);  | 
|                 ItemCellModel cellModel = new ItemCellModel(wellItem.itemId, false, (ulong)wellItem.itemCount);  | 
|                 itemBaisc.Init(cellModel);  | 
|                 itemBaisc.button.RemoveAllListeners();  | 
|                 itemBaisc.button.AddListener(() =>  | 
|                 {  | 
|                     ItemTipUtility.Show(wellItem.itemId);  | 
|                 });  | 
|             }  | 
|             else  | 
|             {  | 
|                 contain_Name.SetActive(false);  | 
|                 itemBaisc.SetActive(false);  | 
|                 noneItemObj.SetActive(true);  | 
|                 bestIcon.SetActive(false);  | 
|                 noneItemBtn.AddListener(()=>  | 
|                 {  | 
|                     wishingModel.SetHandMovePos(index);  | 
|                 });  | 
|             }  | 
|         }  | 
|     }  | 
| }  |