# 参数异常：TilemapCollider2D：无效的边界。瓦片地图边界为空。

- **ID:** `unity/tilemap-collider-invalid-bounds`
- **领域:** unity
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 90%

## 根因

TilemapCollider2D 组件添加到了没有放置任何瓦片的瓦片地图上，导致碰撞体计算出空边界。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Unity 2022.3.5f1 | active | — | — |
| Unity 2023.2.0b2 | active | — | — |

## 解决方案

1. ```
   使用瓦片调色板或脚本在瓦片地图上至少放置一个瓦片：`tilemap.SetTile(new Vector3Int(0, 0, 0), yourTile);`。
   ```
2. ```
   如果瓦片地图应为空，则移除 TilemapCollider2D 组件，或使用 CompositeCollider2D 配合独立的碰撞体设置。
   ```

## 无效尝试

- **** — Disabling and re-enabling the collider does not fix the empty bounds; the collider still has no tiles to compute from. (80% 失败率)
- **** — Setting the Tilemap's cell size to zero or negative values may cause other errors but not resolve the empty bounds. (90% 失败率)
