mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 10:35:34 +00:00
Weapon switching
This commit is contained in:
parent
4d62a0a385
commit
036cc4b940
10 changed files with 49 additions and 17 deletions
|
|
@ -9,7 +9,7 @@ namespace Cirno.Scripts.Components.Actors;
|
|||
public partial class PlayerWeaponProvider : Node2D
|
||||
{
|
||||
[Export] public PackedScene WeaponTemplate { get; private set; }
|
||||
public Array<Weapon> EquippedWeapons { get; set; } = new Array<Weapon>();
|
||||
public Array<Weapon> EquippedWeapons { get; set; } = [];
|
||||
public int CurrentWeaponIndex { get; set; } = 0;
|
||||
|
||||
private InventoryManager _inventoryManager;
|
||||
|
|
|
|||
|
|
@ -187,4 +187,16 @@ public partial class Active : PlayerStateBase
|
|||
{
|
||||
_activationProvider.HandleInteraction();
|
||||
}
|
||||
|
||||
private void HandleWeaponSwitch()
|
||||
{
|
||||
if (_inputProvider.GetWeaponNextJustPressed())
|
||||
{
|
||||
_weaponProvider.NextWeapon();
|
||||
}
|
||||
else if (_inputProvider.GetWeaponPreviousJustPressed())
|
||||
{
|
||||
_weaponProvider.PreviousWeapon();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue