|
@@ -18,30 +18,35 @@ namespace GFGGame
|
|
private GImage _imgNotHas;
|
|
private GImage _imgNotHas;
|
|
private GImage _imgHas;
|
|
private GImage _imgHas;
|
|
private GImage _imgShouTong;
|
|
private GImage _imgShouTong;
|
|
|
|
+ private Controller _qualityType;
|
|
|
|
+ private Controller _scaleType;
|
|
// private GGroup _grpCount;
|
|
// private GGroup _grpCount;
|
|
private bool _showTips = true;
|
|
private bool _showTips = true;
|
|
-
|
|
|
|
|
|
+ private bool _textScale = false;
|
|
|
|
|
|
private ItemData _itemData;
|
|
private ItemData _itemData;
|
|
|
|
|
|
- public ItemView(GComponent obj)
|
|
|
|
|
|
+ public ItemView(GComponent obj,bool textScale = false)
|
|
{
|
|
{
|
|
_obj = obj;
|
|
_obj = obj;
|
|
_item = obj.GetChild("comItemIcon").asCom;
|
|
_item = obj.GetChild("comItemIcon").asCom;
|
|
_loaIcon = _item.GetChild("loaIcon") as GLoader;
|
|
_loaIcon = _item.GetChild("loaIcon") as GLoader;
|
|
_loaRarity = _item.GetChild("loaRarity") as GLoader;
|
|
_loaRarity = _item.GetChild("loaRarity") as GLoader;
|
|
_txtName = obj.GetChild("txtName") as GTextField;
|
|
_txtName = obj.GetChild("txtName") as GTextField;
|
|
- _txtCount = obj.GetChild("txtCount") as GTextField;
|
|
|
|
|
|
+ _txtCount = _item.GetChild("txtCount") as GTextField;
|
|
_txtHasCount = _item.GetChild("txtHasCount") as GTextField;
|
|
_txtHasCount = _item.GetChild("txtHasCount") as GTextField;
|
|
// _imgGot = obj.GetChild("imgGot") as GImage;
|
|
// _imgGot = obj.GetChild("imgGot") as GImage;
|
|
_grpGot = _item.GetChild("grpGot") as GGroup;
|
|
_grpGot = _item.GetChild("grpGot") as GGroup;
|
|
_imgNotHas = _item.GetChild("imgNotHas") as GImage;
|
|
_imgNotHas = _item.GetChild("imgNotHas") as GImage;
|
|
_imgHas = _item.GetChild("imgHas") as GImage;
|
|
_imgHas = _item.GetChild("imgHas") as GImage;
|
|
_imgShouTong = _item.GetChild("imgShowTong") as GImage;
|
|
_imgShouTong = _item.GetChild("imgShowTong") as GImage;
|
|
|
|
+ _qualityType = _item.GetController("QualityType") as Controller;
|
|
|
|
+ _scaleType = _item.GetController("ScaleType") as Controller;
|
|
// _grpCount = obj.GetChild("grpCount") as GGroup;
|
|
// _grpCount = obj.GetChild("grpCount") as GGroup;
|
|
// AddClickListener();
|
|
// AddClickListener();
|
|
_item.onClick.Remove(AddClickListener);
|
|
_item.onClick.Remove(AddClickListener);
|
|
_item.onClick.Add(AddClickListener);
|
|
_item.onClick.Add(AddClickListener);
|
|
|
|
+ _textScale = textScale;
|
|
}
|
|
}
|
|
public void Dispose()
|
|
public void Dispose()
|
|
{
|
|
{
|
|
@@ -82,6 +87,11 @@ namespace GFGGame
|
|
_txtName.text = itemCfg.name;
|
|
_txtName.text = itemCfg.name;
|
|
_txtCount.text = string.Format("{0}", _itemData.num);
|
|
_txtCount.text = string.Format("{0}", _itemData.num);
|
|
_txtHasCount.SetVar("count", "" + ItemDataManager.GetItemNum(_itemData.id)).FlushVars();
|
|
_txtHasCount.SetVar("count", "" + ItemDataManager.GetItemNum(_itemData.id)).FlushVars();
|
|
|
|
+
|
|
|
|
+ if(itemCfg.rarity > 0)
|
|
|
|
+ _qualityType.selectedIndex = itemCfg.rarity - 1;
|
|
|
|
+
|
|
|
|
+ _scaleType.selectedIndex = _textScale ? 1 : 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|