48 lines
1.5 KiB
C#
48 lines
1.5 KiB
C#
using UnityEngine;
|
|
|
|
namespace MedievalShopkeeper
|
|
{
|
|
/// <summary>
|
|
/// Interface for all interactable objects in the shop, such as shelves,
|
|
/// stock deliveries, customers, thief NPCs, and counters.
|
|
/// </summary>
|
|
public interface IInteractable
|
|
{
|
|
/// <summary>
|
|
/// Display text or prompt shown to the player (e.g. "Restock Shelf", "Talk to Customer").
|
|
/// </summary>
|
|
string InteractionPrompt { get; }
|
|
|
|
/// <summary>
|
|
/// The transform/position the player needs to reach to interact.
|
|
/// </summary>
|
|
Transform InteractionTransform { get; }
|
|
|
|
/// <summary>
|
|
/// Maximum distance from the object within which the player can interact.
|
|
/// </summary>
|
|
float InteractionDistance { get; }
|
|
|
|
/// <summary>
|
|
/// Whether the player is currently allowed to interact with this object.
|
|
/// </summary>
|
|
bool CanInteract(PlayerController player);
|
|
|
|
/// <summary>
|
|
/// Performs the interaction when the player reaches the target or right-clicks within range.
|
|
/// </summary>
|
|
void Interact(PlayerController player);
|
|
|
|
/// <summary>
|
|
/// Called when the pointer hovers over this interactable.
|
|
/// </summary>
|
|
void OnHoverEnter(PlayerController player);
|
|
|
|
/// <summary>
|
|
/// Called when the pointer ceases hovering over this interactable.
|
|
/// </summary>
|
|
void OnHoverExit(PlayerController player);
|
|
}
|
|
}
|
|
|