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); } }
public bool VerifyPickup(InventoryItem target) { if(inventoryLimit) { if (target.GetUnits() + GetCurrentUnits() > maximumUnits) return false; } if (!target.CanPickup()) return false; return true; }
void InvokeOnItemPickup(InventoryItem target) { Refresh(); if (list != null) foreach (IIE t in list) { t.OnItemPickup(target); } }
public void ItemEnterPickupArea(InventoryItem target) { if(automaticPickup) AttemptPickup(target); InvokeOnItemEnterPickupArea(target); }
public void AttemptPickup(InventoryItem target) { if (VerifyPickup(target)) Pickup(target); }
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); }