//public InnventoryItem itemSelect; public void OnItemClicked() { ItemDragHendler dragHandler = gameObject.transform.Find("Item").GetComponent <ItemDragHendler>(); if (dragHandler.Item != null) { InnventoryItem item = dragHandler.Item; if (item != null) { Debug.Log(item.Name); } else { Debug.Log("hiiiii"); } } else { Debug.Log("nooooo"); } //item.OnUse(); }
private void OnControllerColliderHit(ControllerColliderHit hit) { InnventoryItem item = hit.collider.GetComponent <InnventoryItem>(); if (item != null) { inventory.AddItem(item); } }
public void AddItem(InnventoryItem item) { if (mItems.Count < SLOTS) { mItems.Add(item); item.OnPickup(); if (ItemAdded != null) { ItemAdded(this, new InventoryEventArgs(item)); } } }
public InventoryEventArgs(InnventoryItem item) { Item = item; }