public void UnequipItem(ItemInst item) { BaseInst.UnequipItem(item.BaseInst); OnUnequip?.Invoke(item); }
private void Unequip(EquipmentSlot equipmentSlot) { var go = _dictionary[equipmentSlot].gameObject; _dictionary.Remove(equipmentSlot); OnUnequip?.Invoke(go.GetComponent <WeaponData>()); Destroy(go); }
public virtual void Unequip(EntityEquipable eq) { if (GetEquipped(eq.Type) == eq) { SetEquipped(eq.Type, null); OnUnequip.Invoke(master, eq); } }
public void UnequipItem(ItemInst item) { pBeforeUnequip(item); this.BaseInst.UnequipItem(item.BaseInst); pAfterUnequip(item); OnUnequip?.Invoke(item); }
public void UnequipFromBodySlot(BodyPart bodyPart) { var equip = activeEquipment[(int)bodyPart]; if (equip != null) { OnUnequip?.Invoke(equip); activeEquipment[(int)bodyPart] = null; } }
public virtual void Unequip(EntityEquipableType type) { EntityEquipable oldEq = GetEquipped(type); if (oldEq != null) { SetEquipped(type, null); OnUnequip.Invoke(master, oldEq); } }
/// <summary> /// Unequips an item from the inventory /// </summary> /// <param name="obj">The object to unequip</param> public void Unequip(Entity entity) { for (var i = 0; i < activeEquipment.Length; ++i) { if (activeEquipment[i] == entity) { OnUnequip?.Invoke(entity); activeEquipment[i] = null; break; } } }
/// <summary> /// Unequips an item from the inventory by name /// </summary> /// <param name="name">The name of the equipment</param> public void Unequip(string name) { for (var i = 0; i < activeEquipment.Length; ++i) { var equip = activeEquipment[i]; if (equip != null && (equip.name == name || equip.id == name)) { OnUnequip?.Invoke(equip); activeEquipment[i] = null; break; } } }
private void Unequip(EquipmentSlot equipmentDataSlot, bool destroyGo = true) { var go = slotToGameobjectDictionary[equipmentDataSlot]; slotToGameobjectDictionary.Remove(equipmentDataSlot); OnUnequip?.Invoke(equipmentDataSlot, go.GetComponent <EquipmentData>()); equipment.Remove(go); if (!destroyGo) { return; } if (Application.isPlaying) { Destroy(go); } else { DestroyImmediate(go); } }