예제 #1
0
    //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();
    }
예제 #2
0
    private void OnControllerColliderHit(ControllerColliderHit hit)
    {
        InnventoryItem item = hit.collider.GetComponent <InnventoryItem>();

        if (item != null)
        {
            inventory.AddItem(item);
        }
    }
예제 #3
0
 public void AddItem(InnventoryItem item)
 {
     if (mItems.Count < SLOTS)
     {
         mItems.Add(item);
         item.OnPickup();
         if (ItemAdded != null)
         {
             ItemAdded(this, new InventoryEventArgs(item));
         }
     }
 }
예제 #4
0
 public InventoryEventArgs(InnventoryItem item)
 {
     Item = item;
 }