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