This commit is contained in:
2023-06-16 19:10:51 +03:00
parent cf6dbed1f5
commit 69f9b0bd4b
8 changed files with 1125 additions and 119 deletions

View File

@@ -184,6 +184,25 @@ namespace Level
}
public bool UnoccupiedTargetExists()
{
// This can be optimized by creating a mapping to all target points
// But I'm not doing that
for (int y = 0; y < height; y++)
{
for (int x = 0; x < width; x++)
{
if (layout[y][x].cellData.isTarget && layout[y][x].cellData.cellContent != LayoutCell.LayoutCellData.CellContent.Crate)
{
return true;
}
}
}
return false;
}
private void EditCellAt(Vector3 worldPos)
{
LayoutCell layoutCell = WorldToLayoutCell(worldPos);