Adding 9 Player level
This commit is contained in:
parent
fdada6f132
commit
a7be12fa9b
30 changed files with 45984 additions and 300 deletions
|
|
@ -75,21 +75,28 @@ namespace TD.Levels
|
|||
if (!TryGetTightTileRect(out Vector2Int minTile, out Vector2Int maxTile)) return;
|
||||
|
||||
const float thickness = 0.04f;
|
||||
float halfTile = GridCoordinates.TILE_SIZE * 0.5f;
|
||||
float tileSize = GridCoordinates.TILE_SIZE;
|
||||
|
||||
// Three concentric rectangles: the original edge, slightly inset, slightly outset.
|
||||
DrawOutlineAtInset(minTile, maxTile, halfTile, yLevel, 0f, outlineColor);
|
||||
DrawOutlineAtInset(minTile, maxTile, halfTile, yLevel, +thickness, outlineColor);
|
||||
DrawOutlineAtInset(minTile, maxTile, halfTile, yLevel, -thickness, outlineColor);
|
||||
DrawOutlineAtInset(minTile, maxTile, tileSize, yLevel, 0f, outlineColor);
|
||||
DrawOutlineAtInset(minTile, maxTile, tileSize, yLevel, +thickness, outlineColor);
|
||||
DrawOutlineAtInset(minTile, maxTile, tileSize, yLevel, -thickness, outlineColor);
|
||||
}
|
||||
|
||||
private static void DrawOutlineAtInset(Vector2Int minTile, Vector2Int maxTile, float halfTile,
|
||||
// Tile (x, y) spans world XZ [x, x+1] (edge-aligned). The outline corners are at the
|
||||
// tile rect's outer edges; `inset` shifts them outward (positive) or inward (negative)
|
||||
// to draw the concentric thickness rectangles.
|
||||
private static void DrawOutlineAtInset(Vector2Int minTile, Vector2Int maxTile, float tileSize,
|
||||
float yLevel, float inset, Color color)
|
||||
{
|
||||
Vector3 sw = new Vector3(minTile.x - halfTile - inset, yLevel, minTile.y - halfTile - inset);
|
||||
Vector3 se = new Vector3(maxTile.x + halfTile + inset, yLevel, minTile.y - halfTile - inset);
|
||||
Vector3 ne = new Vector3(maxTile.x + halfTile + inset, yLevel, maxTile.y + halfTile + inset);
|
||||
Vector3 nw = new Vector3(minTile.x - halfTile - inset, yLevel, maxTile.y + halfTile + inset);
|
||||
float minX = minTile.x * tileSize - inset;
|
||||
float maxX = (maxTile.x + 1) * tileSize + inset;
|
||||
float minZ = minTile.y * tileSize - inset;
|
||||
float maxZ = (maxTile.y + 1) * tileSize + inset;
|
||||
Vector3 sw = new Vector3(minX, yLevel, minZ);
|
||||
Vector3 se = new Vector3(maxX, yLevel, minZ);
|
||||
Vector3 ne = new Vector3(maxX, yLevel, maxZ);
|
||||
Vector3 nw = new Vector3(minX, yLevel, maxZ);
|
||||
|
||||
Color prev = Gizmos.color;
|
||||
Gizmos.color = color;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue