예제 #1
0
    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);
    }
예제 #2
0
    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);
    }
예제 #3
0
 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);
 }
예제 #4
0
 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;
     }
 }