public static void DropActive(PlayerController player, InventoriesController invController, int count) { var tempItem = new Item { itemType = invController.activeItem.itemType, amount = count }; WorldItem.DropItem(player.transform.position, tempItem, player.facingRight); if (invController.activeItem.amount == count) { invController.DestroyActive(); } else { invController.activeItem.amount--; if (invController.activeItem.amount <= 0) { invController.DestroyActive(); } else { invController.activeTransform.Find("Amount").GetComponent <TextMeshProUGUI>().text = invController.activeItem.amount.ToString(); } } }
public void DropItem(Item item) { WorldItem.DropItem(player.transform.position, item, player.facingRight); }