public static void SetItem(Item item) { Image image = _instance._itemImages[(int)item.Slot]; image.sprite = ItemImageLoader.GetSprite(item); image.color = new Color(1, 1, 1, 1); }
public void SetItem(Item item) { Item = item; //Texture will not be null, because ItemBox.SetItem() is called only after //ItemImageLoader.AllLoaded() == true _itemImage.sprite = ItemImageLoader.GetSprite(item); Color averageColor = AverageColor(ItemImageLoader.GetTexture(item)); _backgroundImage.color = Color.Lerp(_origBackgroundColor, averageColor, 0.8f); }
public void Show(Item item) { _showing = true; _window.SetActive(true); Audio.PlaySound(_showHideSound); Item = item; _itemName.text = item.Name; _source.text = item.Source; _description.text = item.Description; _itemImage.sprite = ItemImageLoader.GetSprite(item); _attributesDisplay.UpdateView(item.Attributes); }
public void Show(Item item) { _showing = true; _window.SetActive(true); AudioManager.Play(_showHideSound); Item = item; _itemName.text = item.Name; _source.text = item.Source; _description.text = item.Description; _itemImage.sprite = ItemImageLoader.GetSprite(item); _attributesDisplay.UpdateView(item.Attributes); if (!Equipment.IsEquipped(item)) { _equipText.text = "Equip"; _equipButtonImage.color = _equipColor; } else { _equipText.text = "Unequip"; _equipButtonImage.color = _unequipColor; } }