UnityTowerDefense/Assets/_Project/Scripts/Gameplay/SpellHotkeys.cs

29 lines
964 B
C#

// Assets/_Project/Scripts/Gameplay/SpellHotkeys.cs
using UnityEngine.InputSystem;
namespace TD.Gameplay
{
/// <summary>
/// The fixed key bound to each spell hotkey slot (slot index == grant order ==
/// <see cref="PlayerSpellLoadout"/> list index). Shared by
/// <see cref="BuilderSpellCastController"/> (reads input) and the HUD hotbar (renders key
/// labels) so the two can never drift apart.
/// </summary>
/// <remarks>
/// <see cref="TD.UI.HUDController"/>'s <c>HotkeyLayout</c> already claims the entire
/// Q/W/E/R/T/A/S/D/F/G/Z/X/C/V/B block for the build command grid, so spell casting uses
/// the number row instead.
/// </remarks>
public static class SpellHotkeys
{
public static readonly Key[] Layout =
{
Key.Digit1,
Key.Digit2,
Key.Digit3,
Key.Digit4,
};
public static int MaxSpellSlots => Layout.Length;
}
}