Class ChunkVisibilityDataLayer
DataLayer with Visibility info for each terrain chunk
Inheritance
Inherited Members
Namespace: Fwt.HexTerrains.DataLayers
Assembly: fwt.hexterrains.dll
Syntax
public class ChunkVisibilityDataLayer : HexTerrainNativeListChunkedDataLayer<ChunkVisibility>, IDisposable, ICommitChanges, IListDataLayer<ChunkVisibility>
Fields
NewInvisibleChunks
This is a set of chunks that just became invisible this frame
Declaration
public NativeParallelHashSet<int> NewInvisibleChunks
Field Value
| Type | Description |
|---|---|
| NativeParallelHashSet<int> |
NewVisibleChunks
This is a set of chunks that just became visible this frame
Declaration
public NativeParallelHashSet<int> NewVisibleChunks
Field Value
| Type | Description |
|---|---|
| NativeParallelHashSet<int> |
VisibleChunks
This is a set of chunks that are visible at the moment.
Declaration
public NativeParallelHashSet<int> VisibleChunks
Field Value
| Type | Description |
|---|---|
| NativeParallelHashSet<int> |
Properties
CellsGridSize
Size of the ChunkVisibilityDataLayer (equals to the chunks count)
Declaration
public override int2 CellsGridSize { get; }
Property Value
| Type | Description |
|---|---|
| int2 |
Overrides
ChunkGridSize
Size of the chunks grid. For this particular layer is equals to the CellsGridSize, because we have one item per chunk here
Declaration
public override int2 ChunkGridSize { get; }
Property Value
| Type | Description |
|---|---|
| int2 |
Overrides
ChunkSize
Size of the DataLayer chunk (not the same as terrain chunk). Because this layer contains one item per chunk, the size of the DataLayer chunk is 1x1
Declaration
public override int2 ChunkSize { get; }
Property Value
| Type | Description |
|---|---|
| int2 |
Overrides
IsConnectedHorizontally
If true, the terrain edges are connected horizontally (left-right)
Declaration
public override bool IsConnectedHorizontally { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Overrides
IsConnectedVertically
If true, the terrain edges are connected vertically (top-down)
Declaration
public override bool IsConnectedVertically { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Overrides
IsDisposableItems
If true, the items in this layer are disposable. In this particular case the items are not disposable, because they are not created in the heap
Declaration
public override bool IsDisposableItems { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Overrides
Methods
Cleanup()
Cleans up the layer. Called every frame. Usually it clears the dirty flags.
Declaration
public override void Cleanup()
Overrides
CleanupAsync()
Async version of Cleanup. Instead of waiting for cleanup jobs to complete, this one just schedules jobs and returns the job handle.
Declaration
public override JobHandle CleanupAsync()
Returns
| Type | Description |
|---|---|
| JobHandle | JobHandle for the scheduled cleanup jobs |
Overrides
Dispose()
Disposes the data layer, calls DisposeAllItems() DisposeAllItems()
Declaration
public override void Dispose()
Overrides
Init(int)
Initializes/Reinitializes the layer with the given size
Declaration
public override void Init(int layerSize)
Parameters
| Type | Name | Description |
|---|---|---|
| int | layerSize |