Class ChunkMeshSourcesDataLayer
Data layer for storing mesh sources for hex terrain chunks MeshSource
Inheritance
Inherited Members
Namespace: Fwt.HexTerrains.DataLayers
Assembly: fwt.hexterrains.dll
Syntax
public class ChunkMeshSourcesDataLayer : HexTerrainNativeListChunkedDataLayer<MeshSource>, IDisposable, ICommitChanges, IListDataLayer<MeshSource>
Properties
CellsGridSize
Width and Height of the grid of cells.
Declaration
public override int2 CellsGridSize { get; }
Property Value
| Type | Description |
|---|---|
| int2 |
Overrides
ChunkGridSize
Width and Height of the grid of chunks.
Declaration
public override int2 ChunkGridSize { get; }
Property Value
| Type | Description |
|---|---|
| int2 |
Overrides
ChunkSize
Width and Height of the chunk in cells.
Declaration
public override int2 ChunkSize { get; }
Property Value
| Type | Description |
|---|---|
| int2 |
Overrides
GeneratedMeshIndexes
Declaration
public NativeList<int> GeneratedMeshIndexes { get; }
Property Value
| Type | Description |
|---|---|
| NativeList<int> |
IsConnectedHorizontally
True if left and right edges of the chunk are connected (like in civilization games). Needed for wrapping the grid. If SetCellDirty(cellIndex, checkEdges) is called with checkEdges == true, the chunk of the cell is marked dirty and also all adjacent chunks are also marked dirty. So if the left edge is dirty, the right edge is also dirty.
Declaration
public override bool IsConnectedHorizontally { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Overrides
IsConnectedVertically
True if top and bottom edges of the chunk are connected (like in civilization games). Needed for wrapping the grid. If SetCellDirty(cellIndex, checkEdges) is called with checkEdges == true, the chunk of the cell is marked dirty and also all adjacent chunks are also marked dirty. So if the top edge is dirty, the bottom edge is also dirty.
Declaration
public override bool IsConnectedVertically { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Overrides
IsDisposableItems
If true, means when layer is resized or disposed, all items that are removed will be disposed (see nested classes description for details as the process may be different from layer to layer)
Declaration
public override bool IsDisposableItems { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Overrides
Methods
Cleanup()
Declaration
public override void Cleanup()
Overrides
CleanupAsync()
Declaration
public override JobHandle CleanupAsync()
Returns
| Type | Description |
|---|---|
| JobHandle |
Overrides
Dispose()
Disposes the data layer, calls DisposeAllItems() DisposeAllItems()
Declaration
public override void Dispose()
Overrides
Init(int, HexTerrainSettings)
Initializes/Reinitializes the data layer with the given size and settings. Use this initialization method instead of base.Init without HexTerrainSettings parameter, as this one will also initialize the chunks data
Declaration
public override void Init(int layerSize, HexTerrainSettings settings)
Parameters
| Type | Name | Description |
|---|---|---|
| int | layerSize | amount of meshes for terrain (amount of terrain chunks) |
| HexTerrainSettings | settings | settings of the hex terrain this layer is from |