public void OnLootItemClicked(LootContainer container, Storable item, GameObject slot) { var unit = Game.player.GetComponent <Unit>(); if (unit.storage.inventory.Count + 1 < unit.storage.inventorySize) { unit.storage.inventory.Add(item); container.loot.Remove(item); DestroyImmediate(slot); } if (container.loot.Count == 0) { container.isActive = false; container.Highlight(false); OnCloseLootWindowClicked(); } UI.Hide("ItemDescription"); }