More cleanup

This commit is contained in:
2026-06-15 13:04:52 +02:00
parent 8610c6be53
commit 246718f1bd
2 changed files with 1 additions and 11 deletions

View File

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

View File

@@ -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)