Add main menu scene, setup framework for orientation switching

This commit is contained in:
Michal Pikulski
2025-09-08 12:44:31 +02:00
parent dec34b0ef3
commit 749d72904e
28 changed files with 1999 additions and 67 deletions

View File

@@ -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;
}