Add main menu scene, setup framework for orientation switching
This commit is contained in:
@@ -149,18 +149,29 @@ public class InputManager : MonoBehaviour
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to delegate a tap to an interactable at the given world position.
|
||||
/// Traces on the "Interactable" channel and logs detailed info.
|
||||
/// </summary>
|
||||
private bool TryDelegateToInteractable(Vector2 worldPos)
|
||||
{
|
||||
Collider2D hit = Physics2D.OverlapPoint(worldPos);
|
||||
LayerMask mask = GameManager.Instance != null ? GameManager.Instance.InteractableLayerMask : -1;
|
||||
Collider2D hit = Physics2D.OverlapPoint(worldPos, mask);
|
||||
if (hit != null)
|
||||
{
|
||||
var interactable = hit.GetComponent<ITouchInputConsumer>();
|
||||
if (interactable != null)
|
||||
{
|
||||
Debug.unityLogger.Log("Interactable", $"[InputManager] Delegating tap to interactable at {worldPos} (GameObject: {hit.gameObject.name})");
|
||||
interactable.OnTap(worldPos);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.unityLogger.Log("Interactable", $"[InputManager] Collider2D hit at {worldPos} (GameObject: {hit.gameObject.name}), but no ITouchInputConsumer found.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.unityLogger.Log("Interactable", $"[InputManager] No Collider2D found at {worldPos} for interactable delegation.");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user