Class TycoonTileRendererBase
The base class that any Tycoon Tile renderer should implement. The base class is responsible for subscribing to map events, rendering chunks and keeping track of which chunks need updating.
Inheritance
UnityEngine.Object
UnityEngine.Component
UnityEngine.Behaviour
UnityEngine.MonoBehaviour
TycoonTileRendererBase
Implements
Namespace: TycoonTerrain.Components
Assembly: TycoonTerrainAssembly.dll
Syntax
[RequireComponent(typeof(TycoonTileMap))]
public abstract class TycoonTileRendererBase : MonoBehaviour, IChunkListener
Fields
CastShadows
The cast shadows mode.
Declaration
public ShadowCastingMode CastShadows
Field Value
Type | Description |
---|---|
UnityEngine.Rendering.ShadowCastingMode |
ReceiveShadows
Wether the terrain meshes receive shadows.
Declaration
public bool ReceiveShadows
Field Value
Type | Description |
---|---|
Boolean |
terrain
Holds a reference to the terrain component.
Declaration
protected TycoonTileMap terrain
Field Value
Type | Description |
---|---|
TycoonTileMap |
TerrainTypes
The terrain types collection.
Declaration
public TerrainTypeCollectionAsset TerrainTypes
Field Value
Type | Description |
---|---|
TerrainTypeCollectionAsset |
Methods
OnUpdateChunks(TycoonTileMap, ref ChunkSet)
Gets called after completing all operations for this frame. Meshes should be updated in this scope.
Declaration
public void OnUpdateChunks(TycoonTileMap terrain, ref ChunkSet dirtyChunks)
Parameters
Type | Name | Description |
---|---|---|
TycoonTileMap | terrain | The terrain |
ChunkSet | dirtyChunks |
UpdateChunkMeshes(IEnumerable<int2>, IDictionary<int2, IMesh>)
The method to implement that defines what chunks will look like. Will be called when any chunk has been modified this frame.
Declaration
protected abstract void UpdateChunkMeshes(IEnumerable<int2> chunksToUpdate, IDictionary<int2, IMesh> meshes)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Unity.Mathematics.int2> | chunksToUpdate | The chunk positions that need updating. |
IDictionary<Unity.Mathematics.int2, IMesh> | meshes | The collection of meshes for each chunk position. |