21 lines
510 B
C#
21 lines
510 B
C#
using UnityEngine;
|
|
using System;
|
|
|
|
public class Interactable : MonoBehaviour, ITouchInputConsumer
|
|
{
|
|
public event Action Interacted;
|
|
|
|
// Called by InputManager when this interactable is clicked/touched
|
|
public void OnTouchPress(Vector2 worldPosition)
|
|
{
|
|
Debug.Log($"Interactable.OnTouchPress at {worldPosition} on {gameObject.name}");
|
|
Interacted?.Invoke();
|
|
}
|
|
|
|
public void OnTouchPosition(Vector2 screenPosition)
|
|
{
|
|
// Optionally handle drag/move here
|
|
}
|
|
}
|
|
|