Files
Emberwild/Assets/GAME/Script/Player/HeldItems/IHeldItemBehaviour.cs
T
2026-06-22 16:18:34 +02:00

22 lines
917 B
C#

using Ashwild.Inventory;
namespace Ashwild.Player
{
/// <summary>
/// Logic carried by a held-item prefab (a tool, food, weapon, ...). The prefab is
/// spawned in the hand when the item is drawn and destroyed when it is put away,
/// so each behaviour simply subscribes to the use input while it is alive — the
/// equipped item is the only one that reacts, with no central dispatcher needed.
/// HotbarController calls Setup right after spawning to link it to the player.
/// </summary>
public interface IHeldItemBehaviour
{
/// <summary>
/// Links the freshly spawned held item to the player: receives the shared
/// player refs and the ItemData this prefab represents. Called once by
/// HotbarController immediately after the prefab is instantiated.
/// </summary>
void Setup(HeldItemContext context, ItemData item);
}
}