using UnityEngine; using System; /// /// Represents an interactable object that can respond to tap input events. /// public class Interactable : MonoBehaviour, ITouchInputConsumer { public event Action StartedInteraction; public event Action InteractionComplete; /// /// Handles tap input. Triggers interaction logic. /// public void OnTap(Vector2 worldPosition) { Debug.Log($"[Interactable] OnTap at {worldPosition} on {gameObject.name}"); StartedInteraction?.Invoke(); } // No hold behavior for interactables. public void OnHoldStart(Vector2 worldPosition) { } public void OnHoldMove(Vector2 worldPosition) { } public void OnHoldEnd(Vector2 worldPosition) { } /// /// Called to interact with this object by a character (player, follower, etc). /// public virtual void OnInteract(Character character) { // In the new architecture, requirements and step checks will be handled by orchestrator. StartedInteraction?.Invoke(); // For now, immediately complete interaction as success (can be extended later). InteractionComplete?.Invoke(true); } public void CompleteInteraction(bool success) { InteractionComplete?.Invoke(success); } }