private void add_ammo_item_to_inventory(EAmmoType type, int amount) { GameObject ammobox = get_object_from_path(Common.ammo_type_to_path[type]); ammobox.name = ammobox.name.Replace("(Clone)", ""); Items.AmmoBox script = ammobox.GetComponent <Items.AmmoBox>(); script.on_pickup(); items_in_backpack.Add(script); //Destroy(ammobox); Debug.Log("Add ammo " + amount); }