Пример #1
0
    public void SetItem(ItemScript item)
    {
        if (spriteRenderer == null || cameraManager == null || itemViewDetailSpriteRenderer == null || equipItemButton == null)
        {
            print("Error in InventoryItemDisplay SetItem34\n");
            return;
        }

        this.item             = item;
        spriteRenderer.sprite = item.GetSprite();
    }
Пример #2
0
 private void OnMouseDown()
 {
     if (itemViewDetailSpriteRenderer == null || cameraManager == null || spriteRenderer == null || item == null)
     {
         print("Error in InventoryItemDisplay OnMouseDown 43\n");
         return;
     }
     itemViewDetailSpriteRenderer.sprite = item.GetSprite();
     itemNameText.text = "Item Name: " + item.GetItemName();
     defenseText.text  = "Defense: " + item.GetDefenseBoost().ToString();
     meeleText.text    = "Meele Attack: " + item.GetMeeleBoost().ToString();
     rangedText.text   = "Ranged Attack: " + item.GetRangedBoost().ToString();
     hungerText.text   = "Hunger: " + item.GetHungerBoost().ToString();
     thirstText.text   = "Thirst: " + item.GetThirstBoost().ToString();
     weightText.text   = "Weight: " + item.GetItemWeight().ToString();
     cameraManager.SendMessage("ActivateItemViewDetail");
     equipItemButton.SetInventoryItemDisplay(this);
 }