public void UnEquipItem(Equippable itemToUnequip) { UIEventHandler.ItemUnequipped(itemToUnequip); characterStats.RemoveStatBonuses(itemToUnequip.Stats); equippedItems.Remove(itemToUnequip); Debug.Log("Unequipped: " + itemToUnequip); TakeItem(itemToUnequip); // unequipped items automatically go to the inventory for now }
public void UnequipArmor(Item item) { SoundDatabase.PlaySound(0); item.Stats.RemoveStatsFromOther(player.Stats); inventoryController.GiveItem(item); Destroy(playerArmor.transform.Find(item.Name).gameObject); UIEventHandler.ItemUnequipped(item); UIEventHandler.StatsChanged(); SoundDatabase.PlaySound(0); }
private void UnequipCurrentWeapon() { if (equippedWeapon != null) { characterStats.RemoveStatBonus(equippedWeapon.GetComponent <IWeapon>().Stats); Destroy(playerHand.transform.GetChild(0).gameObject); UIEventHandler.ItemUnequipped(currentlyEquipedWeaponItem); UIEventHandler.StatsChanged(); currentlyEquipedWeaponItem = null; weaponComponent = null; } }
public void UnequipWeapon(Item item) { if (EquippedWeapon != null) { SoundDatabase.PlaySound(0); //print("unequipped"); //print(equippedWeapon.Stats.Physical); equippedWeapon.Stats.RemoveStatsFromOther(player.Stats); inventoryController.GiveItem(currentlyEquippedItem.Name); Destroy(playerHand.transform.GetChild(0).gameObject); UIEventHandler.ItemUnequipped(item); UIEventHandler.StatsChanged(); } }