| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 | 
							- using FairyGUI;
 
- namespace GFGGame
 
- {
 
-     public class ItemView
 
-     {
 
-         private GComponent _obj;
 
-         private GLoader _loaIcon;
 
-         private GLoader _loaRarity;
 
-         private GTextField _txtName;
 
-         private GTextField _txtCount;
 
-         private GTextField _txtHasCount;
 
-         private GImage _imgGot;
 
-         private ItemData _itemData;
 
-         public ItemView(GComponent obj)
 
-         {
 
-             _obj = obj;
 
-             _loaIcon = obj.GetChild("loaIcon") as GLoader;
 
-             _loaRarity = obj.GetChild("loaRarity") as GLoader;
 
-             _txtName = obj.GetChild("txtName") as GTextField;
 
-             _txtCount = obj.GetChild("txtCount") as GTextField;
 
-             _txtHasCount = obj.GetChild("txtHasCount") as GTextField;
 
-             _imgGot = obj.GetChild("imgGot") as GImage;
 
-             AddClickListener();
 
-         }
 
-         private void AddClickListener()
 
-         {
 
-             _obj.onClick.Add(() => { GoodsItemTipsController.ShowItemTips(_itemData.id); });
 
-         }
 
-         public void SetData(ItemData itemData)
 
-         {
 
-             _itemData = itemData;
 
-             UpdateView();
 
-         }
 
-         private void UpdateView()
 
-         {
 
-             ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(_itemData.id);
 
-             _loaIcon.url = ResPathUtil.GetIconPath(itemCfg);
 
-             RarityIconController.UpdateRarityIcon(_loaRarity, _itemData.id, false);
 
-             _imgGot.visible = false;
 
-             _txtName.text = itemCfg.name;
 
-             _txtCount.SetVar("count", _itemData.num.ToString()).FlushVars();
 
-             _txtHasCount.SetVar("count", "" + ItemDataManager.GetItemNum(_itemData.id)).FlushVars();
 
-         }
 
-         /// <summary>
 
-         /// “已领取”显示状态
 
-         /// </summary>
 
-         /// <value></value>
 
-         public bool ImgGotVisible
 
-         {
 
-             get
 
-             {
 
-                 return _imgGot.visible;
 
-             }
 
-             set
 
-             {
 
-                 _imgGot.visible = value;
 
-             }
 
-         }
 
-         /// <summary>
 
-         /// "已拥有"显示状态
 
-         /// </summary>
 
-         /// <value></value>
 
-         public bool TxtHasCountVisble
 
-         {
 
-             get
 
-             {
 
-                 return _txtHasCount.visible;
 
-             }
 
-             set
 
-             {
 
-                 _txtHasCount.visible = value;
 
-             }
 
-         }
 
-     }
 
- }
 
 
  |