TO SQUASH: Nuke ball fixes.

This commit is contained in:
2026-08-28 17:44:31 -04:00
parent 7e4b5a2055
commit 716e35c615
10 changed files with 153 additions and 15 deletions
+19 -1
View File
@@ -281,7 +281,7 @@ public class WorldFiller : MonoBehaviour
boardArea = boardRect.width * boardRect.height;
}
public bool IsPositionInFreeArea(Vector2 position)
public bool IsPositionInFreeRegion(Vector2 position)
{
if (freeAreas.Count == 0 && gameBoardSpriteRenderer != null)
{
@@ -299,6 +299,24 @@ public class WorldFiller : MonoBehaviour
return false;
}
public float GetAreaPercentOfFreeRegion(Vector2 position)
{
if (freeAreas.Count == 0 && gameBoardSpriteRenderer != null)
{
InitializeFreeAreas();
}
for (int i = 0; i < freeAreas.Count; i++)
{
if (RectContainsWithTolerance(freeAreas[i], position))
{
return (freeAreas[i].width * freeAreas[i].height) / boardArea;
}
}
return -1.0f;
}
public Vector2 GetRandomPositionInFreeAreas(Bounds? clearingArea = null)
{
if (freeAreas.Count == 0 && gameBoardSpriteRenderer != null)