25 lines
638 B
C#
Raw Normal View History

2025-08-11 20:37:42 +05:00
using UnityEngine;
public class AbilityInput : MonoBehaviour
{
[Header("User + Slots")]
public AbilityUser user;
public AbilitySlot[] slots = new AbilitySlot[4];
void Update()
{
foreach (var s in slots) s?.Tick(Time.deltaTime);
// Quick default bindings: 1..4
2025-08-12 12:39:09 +05:00
if (Input.GetKeyDown(KeyCode.Q)) Use(0);
if (Input.GetKeyDown(KeyCode.E)) Use(1);
if (Input.GetKeyDown(KeyCode.R)) Use(2);
if (Input.GetKeyDown(KeyCode.T)) Use(3);
2025-08-11 20:37:42 +05:00
}
public void Use(int index)
{
if (index < 0 || index >= slots.Length) return;
slots[index]?.TryUse(user);
}
}