public void RefreshView() { Icon.sprite = Statics.GetIconSprite(itemData.IconId); NameText.text = string.Format("<color=\"#1ABDE6\">{0}</color>", itemData.Name); PriceText.text = itemData.BuyPrice.ToString(); TypeText.text = string.Format("类型:{0}", Statics.GetItemTypeName(itemData.Type)); }
public void RefreshView() { Icon.sprite = Statics.GetIconSprite(itemData.IconId); NameText.text = string.Format("<color=\"#1ABDE6\">{0}</color>", itemData.Name); TypeText.text = string.Format("类型:{0}", Statics.GetItemTypeName(itemData.Type)); NumText.text = string.Format("数量:{0}/{1}", itemData.Num, itemData.MaxNum); }
public override void RefreshView() { icon.sprite = Statics.GetIconSprite(itemData.IconId); nameText.text = string.Format("<color=\"#1ABDE6\">{0}</color>", itemData.Name); typeText.text = string.Format("类型:{0}", Statics.GetItemTypeName(itemData.Type)); lvText.text = string.Format("等级:{0}级", itemData.Lv); numText.text = string.Format("数量:{0}/{1}", itemData.Num, itemData.MaxNum); if (itemData.SellPrice >= 0) { sellFlagText.text = "回收:"; silverImage.gameObject.SetActive(true); sellPriceText.text = itemData.SellPrice.ToString(); } else { sellFlagText.text = "<color=\"#FF0000\">不可回收</color>"; silverImage.gameObject.SetActive(false); } discardFlagText.text = itemData.CanDiscard ? "<color=\"#00FF00\">可以丢弃</color>" : "<color=\"#FF0000\">不可丢弃</color>"; bg.rectTransform.sizeDelta = new Vector2(bg.rectTransform.sizeDelta.x, 600); destroyBtn.gameObject.SetActive(false); useBtn.gameObject.SetActive(false); if (_fromBag && itemData.CanDiscard) { bg.rectTransform.sizeDelta = new Vector2(bg.rectTransform.sizeDelta.x, 600); destroyBtn.gameObject.SetActive(true); } switch (itemData.Type) { case ItemType.Food: //干粮可以直接吃补充区域大地图体力 bg.rectTransform.sizeDelta = new Vector2(bg.rectTransform.sizeDelta.x, 600); useBtn.gameObject.SetActive(_fromBag); useBtn.GetComponentInChildren <Text>().text = "吃"; break; case ItemType.Weapon: case ItemType.Book: case ItemType.RandomSecre: bg.rectTransform.sizeDelta = new Vector2(bg.rectTransform.sizeDelta.x, 600); useBtn.gameObject.SetActive(true); useBtn.GetComponentInChildren <Text>().text = "打开"; break; default: break; } descText.text = string.Format("描述\n{0}", itemData.Desc); }