23 lines
748 B
C#
23 lines
748 B
C#
namespace ActionRPG.Interfaces
|
|
{
|
|
public enum InteractionType { Press, Hold }
|
|
|
|
/// <summary>
|
|
/// Implement this on any object the player can interact with (doors, chests, NPCs, etc.).
|
|
/// </summary>
|
|
public interface IInteractable
|
|
{
|
|
/// <summary>Whether this object requires a tap (Press) or a held input (Hold).</summary>
|
|
InteractionType InteractionType { get; }
|
|
|
|
/// <summary>Called when the player confirms an interaction.</summary>
|
|
void Interact();
|
|
|
|
/// <summary>Called when the player's raycast enters range of this object.</summary>
|
|
void OnFocused();
|
|
|
|
/// <summary>Called when the player's raycast leaves this object.</summary>
|
|
void OnLostFocus();
|
|
}
|
|
}
|