[Input][Interaction] Add interactable items
This commit is contained in:
@@ -67,10 +67,19 @@ public class InputManager : MonoBehaviour
|
||||
defaultConsumer?.OnTouchPosition(pos);
|
||||
}
|
||||
|
||||
private bool TryDelegateToInteractable(Vector2 screenPos)
|
||||
private bool TryDelegateToInteractable(Vector2 worldPos)
|
||||
{
|
||||
// TODO: Raycast logic to find ITouchInputConsumer at screenPos
|
||||
// For now, always return false (no interactable found)
|
||||
// Raycast at the world position to find an Interactable
|
||||
Collider2D hit = Physics2D.OverlapPoint(worldPos);
|
||||
if (hit != null)
|
||||
{
|
||||
var interactable = hit.GetComponent<Interactable>();
|
||||
if (interactable != null)
|
||||
{
|
||||
interactable.OnTouchPress(worldPos);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user