Пример #1
0
 /// <summary>
 /// Called when a collector collides with this object.
 /// </summary>
 public void PickupItem()
 {
     if (inventory.Add(item))
     {
         //Item is added to inventory and the physical pickup is removed.
         statManager.ChangeScore(itemScore);
         OnPickup.Invoke();
         Destroy(gameObject);
     }
     else
     {
         //Not enough space in inventory to add item.
         inventory.NotEnoughSpace();
     }
 }