miepzerino
2025-04-03 d14aa149918f3f8e4437d4e8b65c13a2b06d212d
Assets/Scripts/GenerateTileMap.cs
@@ -207,7 +207,7 @@
    {
        // Adjust for tilemap offset
        float adjustedX = worldPosition.x - transform.position.x;
        float adjustedY = worldPosition.y - transform.position.y;
        float adjustedY = (worldPosition.y - transform.position.y) + CHUNK_SIZE;
        return new Vector2Int(
            Mathf.FloorToInt(adjustedX / CHUNK_SIZE),
@@ -473,10 +473,17 @@
                        0
                    );
                    // Draw chunk boundary
                    Gizmos.DrawWireCube(
                        worldPos + new Vector3(CHUNK_SIZE / 2f, -CHUNK_SIZE / 2f, 0),
                        new Vector3(CHUNK_SIZE, CHUNK_SIZE, 0)
                    );
                    // Draw chunk coordinates
                    UnityEditor.Handles.Label(
                        worldPos + new Vector3(CHUNK_SIZE / 2f, -CHUNK_SIZE / 2f, 0),
                        $"({chunk.x}, {chunk.y})"
                    );
                }
            }
        }