/// <summary>
/// Inventory Next (for weapons etc)
/// </summary>
///
public void OnInventoryNext(InputAction.CallbackContext context)
{
switch (context)
{
case { phase: InputActionPhase.Performed }:
float vec = context.ReadValue<Vector2>().y;
if(vec == -120)
{
previousInventoryKey++;
if(previousInventoryKey > 3)
{
previousInventoryKey = 0;
}
}
else if (vec == 120)
{
previousInventoryKey--;
if (previousInventoryKey < 0)
{
previousInventoryKey = 3;
}
}
intInventoryNext = intInvent[previousInventoryKey];
inputInventoryNext = true;
break;
case { phase: InputActionPhase.Canceled }:
inputInventoryNext = false;
break;
}
}