Struct GridData
Blittable representation of a Grid component's dimensional data, suitable for use inside Burst-compiled Jobs where managed GridLayout references cannot be accessed. A GridData stores the layout of the grid and provides the data required to convert between cell space and local space.
Inherited Members
Namespace: Unity.Tilemaps.Experimental
Assembly: Unity.2D.Tilemap.Experimental.dll
Syntax
public struct GridData
Constructors
GridData(Layout, Swizzle, in float3, in float3)
Initializes a new GridData with the given layout and dimensions.
Declaration
public GridData(GridData.Layout cellLayout, GridData.Swizzle cellSwizzle, in float3 cellSize, in float3 cellGap)
Parameters
| Type | Name | Description |
|---|---|---|
| GridData.Layout | cellLayout | Specifies how cells are arranged in the Grid. |
| GridData.Swizzle | cellSwizzle | Determines the swizzle order applied to Grid cells. |
| float3 | cellSize | The dimensions of individual cells in the Grid. |
| float3 | cellGap | The spacing between adjacent cells in the Grid. |
GridData(GridLayout)
Initializes a new GridData from an existing GridLayout component, copying its layout, swizzle, cell size, and cell gap so the data can be used from Burst-compiled Jobs. Must be called on the main thread.
Declaration
public GridData(GridLayout grid)
Parameters
| Type | Name | Description |
|---|---|---|
| GridLayout | grid | The GridLayout component to read data from. |
Fields
cellGap
The spacing between adjacent cells in the Grid.
Declaration
public float3 cellGap
Field Value
| Type | Description |
|---|---|
| float3 |
cellLayout
Specifies how cells are arranged in the Grid.
Declaration
public GridData.Layout cellLayout
Field Value
| Type | Description |
|---|---|
| GridData.Layout |
cellSize
The dimensions of individual cells in the Grid.
Declaration
public float3 cellSize
Field Value
| Type | Description |
|---|---|
| float3 |
cellSwizzle
Determines the swizzle order applied to Grid cells.
Declaration
public GridData.Swizzle cellSwizzle
Field Value
| Type | Description |
|---|---|
| GridData.Swizzle |