Beispiel #1
0
 void Drop(InventoryItem target)
 {
     if(itemList.Contains(target))
     {
         InvokeOnItemDrop(target);
         itemList.Remove(target);
         target.transform.parent = null;
         target.transform.position = inventoryDropPosition.position;
         target.gameObject.SetActive(true);
     }
 }
Beispiel #2
0
 public bool VerifyPickup(InventoryItem target)
 {
     if(inventoryLimit)
     {
         if (target.GetUnits() + GetCurrentUnits() > maximumUnits)
             return false;
     }
     if (!target.CanPickup())
         return false;
     return true;
 }
Beispiel #3
0
 void InvokeOnItemPickup(InventoryItem target)
 {
     Refresh(); if (list != null) foreach (IIE t in list) { t.OnItemPickup(target); }
 }
Beispiel #4
0
 public void ItemEnterPickupArea(InventoryItem target)
 {
     if(automaticPickup)
         AttemptPickup(target);
     InvokeOnItemEnterPickupArea(target);
 }
Beispiel #5
0
 public void AttemptPickup(InventoryItem target)
 {
     if (VerifyPickup(target))
         Pickup(target);
 }
Beispiel #6
0
 void Pickup(InventoryItem target)
 {
     InvokeOnItemPickup(target);
     target.gameObject.SetActive(false);
     target.transform.parent = inventoryStorer;
     target.transform.localPosition = Vector3.zero;
     target.SetInventory(this);
     itemList.Add(target);
 }