Пример #1
0
    public override GameObject OnTouch()
    {
        if (!isInInventory)
        {
            IInventoryItem inventoryItem = gameObject.GetComponent <IInventoryItem>();

            if (inventoryItem != null)
            {
                Debug.Log($"I am {this.gameObject.name} and I should be in inventory");
                OnItemClicked.Invoke();
                systemTrigger.OnUse();
                isInInventory = true;
                return(inventoryItem.AddToInventory());
            }
        }
        return(this.gameObject);
    }
Пример #2
0
 public void AddToInventory(UnitInventory inv)
 {
     m_item.AddToInventory(inv);
 }