From 246718f1bda6ced3bd65d0862415c36c40f3c668 Mon Sep 17 00:00:00 2001 From: Marro64 Date: Mon, 15 Jun 2026 13:04:52 +0200 Subject: [PATCH] More cleanup --- Assets/Scripts/GridMover.cs | 10 ---------- Assets/Scripts/PacMan.cs | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/Assets/Scripts/GridMover.cs b/Assets/Scripts/GridMover.cs index a605d91..15a0338 100644 --- a/Assets/Scripts/GridMover.cs +++ b/Assets/Scripts/GridMover.cs @@ -227,16 +227,6 @@ namespace Marro.PacManUdon } return result; } - - public static bool CheckCollisionInDirection(Transform transform, Vector2 position, Vector2 direction) - { - // Debug.Log("Collision check"); - bool result = Physics.Linecast(transform.parent.TransformPoint(position), transform.parent.TransformPoint(position + direction.normalized), 1 << 22, QueryTriggerInteraction.Ignore); - // Debug.DrawLine(transform.parent.TransformPoint(position), transform.parent.TransformPoint(position + direction.normalized), Color.red, 1); - // Debug.Log($"{gameObject} Collision; Position {position} became {transform.parent.TransformPoint(position)}, direction {direction.normalized} became {transform.parent.TransformDirection(direction.normalized)}"); - // Debug.Log("collision check for " + position + " in direction " + direction + " returned " + result); - return result; - } #endregion } } \ No newline at end of file diff --git a/Assets/Scripts/PacMan.cs b/Assets/Scripts/PacMan.cs index 5106a95..0775616 100644 --- a/Assets/Scripts/PacMan.cs +++ b/Assets/Scripts/PacMan.cs @@ -178,7 +178,7 @@ namespace Marro.PacManUdon { nextValidDirectionIndex += 1; } - if (!CheckCollisionInDirection(transform, nextPosition, directionVectors[(int)predefinedPath[nextValidDirectionIndex]])) + if (!pelletManager.IsWallUpcoming(nextPosition, directionVectors[(int)predefinedPath[nextValidDirectionIndex]])) { // If we're at a Vector2.zero, we skip applying the direction and only increment. if (nextValidDirectionIndex == predefinedPathIndex)