Implement Equip/Unequip SFX
This commit is contained in:
@@ -384,6 +384,9 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<ISaveChunk<Play
|
||||
|
||||
public void Equip(EquipableItem equipable)
|
||||
{
|
||||
if (string.IsNullOrEmpty(equipable.ItemName))
|
||||
return;
|
||||
|
||||
if (equipable is Weapon weapon)
|
||||
{
|
||||
Unequip(_equippedWeapon.Value);
|
||||
@@ -404,10 +407,15 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<ISaveChunk<Play
|
||||
}
|
||||
else
|
||||
throw new NotImplementedException("Item type is not supported.");
|
||||
|
||||
_gameRepo.OnEquippedItem(equipable);
|
||||
}
|
||||
|
||||
public void Unequip(EquipableItem equipable)
|
||||
{
|
||||
if (string.IsNullOrEmpty(equipable.ItemName))
|
||||
return;
|
||||
|
||||
if (equipable is Weapon weapon)
|
||||
{
|
||||
weapon.IsEquipped = false;
|
||||
@@ -435,6 +443,8 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<ISaveChunk<Play
|
||||
|
||||
if (equipable.ItemTag == ItemTag.BreaksOnChange)
|
||||
Inventory.Remove(equipable);
|
||||
|
||||
_gameRepo.OnUnequippedItem(equipable);
|
||||
}
|
||||
|
||||
private static Vector3 GlobalInputVector
|
||||
|
||||
Reference in New Issue
Block a user