public void Unequip(EquippableItem equipItem) { if (!inventory.IsFull() && EquipPanel.RemoveEquipItem(equipItem)) { switch (equipItem.EquipmentType) { case EquipmentType.Weapon1: CreatePlayer.Instance.SetHandDamage(); Character.Instance.Weapon1Sprite.sprite = null; break; case EquipmentType.Weapon2: Character.Instance.Weapon2Sprite.sprite = null; break; case EquipmentType.Head: Character.Instance.Hair.enabled = true; Character.Instance.HeadSprite.sprite = null; Character.Instance.Anim.SetLayerWeight(1, 0.0f); if (equipItem.DisableHair == false) { Character.Instance.Hair.enabled = true; } break; case EquipmentType.Chest: Character.Instance.ChestSprite.sprite = null; Character.Instance.ChestSprite1.sprite = null; Character.Instance.ChestSprite2.sprite = null; Character.Instance.Shoulder1.sprite = null; Character.Instance.Shoulder2.sprite = null; Character.Instance.Cap.sprite = null; Character.Instance.Cap2.sprite = null; break; case EquipmentType.Legs: Character.Instance.LegsSprite1.sprite = null; Character.Instance.LegsSprite2.sprite = null; Character.Instance.LegsSprite3.sprite = null; break; case EquipmentType.Hands: Character.Instance.HandsSprite1.sprite = null; Character.Instance.HandsSprite2.sprite = null; break; default: break; } if (equipItem.AnimLayer != 0) { Character.Instance.Anim.SetLayerWeight(equipItem.AnimLayer, 0.0f); } if (equipItem.EquipmentType != EquipmentType.Weapon2) { CreatePlayer.Instance.PhysicDEF -= equipItem.PhysicDEF; CreatePlayer.Instance.FireDEF -= equipItem.FireDEF; CreatePlayer.Instance.EletricDEF -= equipItem.EletricDEF; CreatePlayer.Instance.MagicDEF -= equipItem.MagicDEF; CreatePlayer.Instance.PoisonDEF -= equipItem.PoisonDEF; //CreatePlayer.Instance.Weight -= equipItem.Weight; } CreatePlayer.Instance.Weight -= equipItem.Weight; CreatePlayer.Instance.UpdateUI(); inventory.AddItem(equipItem); } }